<!-- 博客 - 页面布局 > 上中下 -->



<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=dark>
<!-- 博客 - 导航栏上方 -->


<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/blog/img/fluid.png">
  <link rel="icon" href="/blog/img/icon/dw.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Memory">
  <meta name="keywords" content="">

  
    <meta name="description" content="🍜 打造高效开发环境，善用 IntelliJ IDEA 的实用技巧，探索Java开发利器与编程基石">
<meta property="og:type" content="article">
<meta property="og:title" content="打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化">
<meta property="og:url" content="https://test.atomgit.net/blog/2023/07/06/%E6%89%93%E9%80%A0%E6%B5%81%E7%95%85%E7%BC%96%E7%A0%81%E4%B9%8B%E6%97%85%EF%BC%9AIntelliJ%20IDEA%20%E7%9A%84%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E4%B8%8E%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B%E4%BC%98%E5%8C%96/index.html">
<meta property="og:site_name" content="Memory&#39;s blog">
<meta property="og:description" content="🍜 打造高效开发环境，善用 IntelliJ IDEA 的实用技巧，探索Java开发利器与编程基石">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://test.atomgit.net/blog/img/artical/town041101.jpg">
<meta property="article:published_time" content="2023-07-06T09:56:20.000Z">
<meta property="article:modified_time" content="2025-07-23T01:37:22.000Z">
<meta property="article:author" content="Memory">
<meta property="article:tag" content="经验">
<meta property="article:tag" content="IDEA">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://test.atomgit.net/blog/img/artical/town041101.jpg">
  
  
  
  <title>打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化 - Memory&#39;s blog</title>

  <link  rel="stylesheet" href="https://lib.baomitu.com/twitter-bootstrap/4.6.1/css/bootstrap.min.css" />



  <link  rel="stylesheet" href="https://lib.baomitu.com/github-markdown-css/4.0.0/github-markdown.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/hint.css/2.7.0/hint.min.css" />

  <link  rel="stylesheet" href="https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.css" />



<!-- 主题依赖的图标库，不要自行修改 -->
<!-- Do not modify the link that theme dependent icons -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_hj8rtnfg7um.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/blog/css/main.css" />


  <link id="highlight-css" rel="stylesheet" href="/blog/css/highlight.css" />
  
    <link id="highlight-css-dark" rel="stylesheet" href="/blog/css/highlight-dark.css" />
  



  
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">



  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    Fluid.ctx = Object.assign({}, Fluid.ctx)
    var CONFIG = {"hostname":"test.atomgit.net","root":"/blog/","version":"1.9.4","typing":{"enable":true,"typeSpeed":100,"cursorChar":"_","loop":false,"scope":[]},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"left","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"code_language":{"enable":true,"default":"TEXT"},"copy_btn":true,"image_caption":{"enable":true},"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"placement":"right","headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":false,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":true,"follow_dnt":true,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"appId":"T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz","appKey":"XFkgzzvzNo3J3uNCbBiSOFKc","server_url":"https://t1huhh9k.lc-cn-n1-shared.com","path":"window.location.pathname","ignore_local":false}},"search_path":"/blog/local-search.xml"};

    if (CONFIG.web_analytics.follow_dnt) {
      var dntVal = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
      Fluid.ctx.dnt = dntVal && (dntVal.startsWith('1') || dntVal.startsWith('yes') || dntVal.startsWith('on'));
    }
  </script>
  <script  src="/blog/js/utils.js" ></script>
  <script  src="/blog/js/color-schema.js" ></script>
  

  

  

  

  

  

  

  



  
<meta name="generator" content="Hexo 5.4.2"></head>

<body>
  

  <header>
    <!-- 博客 - 导航栏上方 -->


<div class="header-inner" style="height: 100vh">
  <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/blog/">
      <strong>Memory&#39;s blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/">
                <i class="iconfont icon-home-fill"></i>
                <span>首页</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                <span>归档</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                <span>分类</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                <span>标签</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/about/">
                <i class="iconfont icon-user-fill"></i>
                <span>关于</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/links/">
                <i class="iconfont icon-link-fill"></i>
                <span>友链</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/playlist/">
                <i class="iconfont icon-music"></i>
                <span>音乐</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/Memos/">
                <i class="iconfont icon-comment "></i>
                <span>说说</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/App/">
                <i class="iconfont icon-mobile"></i>
                <span>咫尺</span>
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" target="_self" href="javascript:;" role="button"
                 data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="iconfont icon-books"></i>
                <span>青简</span>
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="http://47.93.135.62:5230/explore">
                    <i class="iconfont icon-images"></i>
                    <span>碎念微光</span>
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" href="/blog/New/">
                    <i class="iconfont icon-bug"></i>
                    <span>匠册详析</span>
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" href="/blog/New/">
                    <i class="iconfont icon-xbox-fill"></i>
                    <span>窗景新编</span>
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" href="/blog/New/">
                    <i class="iconfont icon-steam"></i>
                    <span>戏码幕后</span>
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" href="/blog/New/">
                    <i class="iconfont icon-map"></i>
                    <span>他山随拾</span>
                  </a>
                
              </div>
            </li>
          
        
        
            <li class="nav-item" id="search-btn">
                <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalNotice" aria-label="Search">
                    <i class="iconfont icon-book"></i>
                    <span>公告</span>
                </a>
            </li>
            
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              <i class="iconfont icon-search"></i>
            </a>
          </li>
          
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">
              <i class="iconfont icon-dark" id="color-toggle-icon"></i>
            </a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>
 
<div id="banner" class="banner" parallax=true
     style="background: url('/blog/img/artical/town041101.jpg') no-repeat center center; background-size: cover;">
  <div class="full-bg-img">

    <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
      <div class="banner-text text-center fade-in-up">

        <div class="h2">
          
            <span id="subtitle" data-typed-text="打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化"></span>
          
        </div>


        
          <!-- 文章页面 - 顶部信息 -->

<div class="mt-3">
  
  <span class="post-meta mr-2">
    <i class="iconfont icon-author" aria-hidden="true"></i>
    Memory
  </span>
   
  <span class="post-meta">
    <i class="iconfont icon-date-fill" aria-hidden="true"></i>
    <time datetime="2023-07-06 17:56" pubdate>
      2023年7月6日 下午
    </time>
  </span>
  
</div>

<div class="mt-1">
  
  <span class="post-meta mr-2">
    <i class="iconfont icon-chart"></i>
     24k 字 
  </span>
   
  <span class="post-meta mr-2">
    <i class="iconfont icon-clock-fill"></i>
       60 分钟 
  </span>
     
  <span
    id="leancloud-page-views-container"
    class="post-meta"
    style="display: none"
  >
    <i class="iconfont icon-eye" aria-hidden="true"></i>
    <span id="leancloud-page-views"></span> 次
  </span>

    
</div>


        

        <!-- 添加网站运行时间 -->
        <div class="footer-content" style="background-color: transparent;">
          <div>
            <span id="timeDate"></span>
            <span id="times"></span>
            <script>
            var now = new Date();
            function createtime(){
                var grt= new Date("03/07/2023 00:00:00");//此处修改你的建站时间或者网站上线时间
                now.setTime(now.getTime()+250);
                days = (now - grt ) / 1000 / 60 / 60 / 24;
                dnum = Math.floor(days);
                hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum);
                hnum = Math.floor(hours);
                if(String(hnum).length ==1 ){
                    hnum = "0" + hnum;
                }
                minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);
                mnum = Math.floor(minutes);
                if(String(mnum).length ==1 ){
                          mnum = "0" + mnum;
                }
                seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);
                snum = Math.round(seconds);
                if(String(snum).length ==1 ){
                          snum = "0" + snum;
                }
                document.getElementById("timeDate").innerHTML = "🚀 &nbsp"+dnum+"&nbsp天";  //此次自定义显示内容
                document.getElementById("times").innerHTML = hnum + "&nbsp小时&nbsp" + mnum + "&nbsp分&nbsp" + snum + "&nbsp秒";
            }  

            if (!window.location.href.includes('/20')) {  
            setInterval("createtime()", 250);  // 只有当URL不包含'specific-page'时，才调用createtime  
            }//此次自定义显示内容
            </script>
          </div>
        </div>

      </div>
      
        <div class="scroll-down-bar">
          <i class="iconfont icon-arrowdown"></i>
        </div>
      
    </div>
  </div>
</div>

</div>

  </header>

  <main>
    
      <!-- 文章页  -->


<div class="container-fluid nopadding-x">

  <div class="row nomargin-x">
    <div class="side-col d-none d-lg-block col-lg-2">
      
  <aside class="sidebar category-bar" style="margin-right: -1rem">
    <!-- 文章页面 - 左边栏所属分类 -->
  

<!-- 文章页 - 文章分类 -->





<div class="category-list">
  
  
    
    
    
    <div class="category row nomargin-x">
      <a class="category-item 
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="代码锋芒"
        id="heading-843238cb7c4b39b52e95311733ff6da6" role="tab" data-toggle="collapse" href="#collapse-843238cb7c4b39b52e95311733ff6da6"
        aria-expanded="true"
      >
        代码锋芒
        <span class="list-group-count">(31)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse show" id="collapse-843238cb7c4b39b52e95311733ff6da6"
           role="tabpanel" aria-labelledby="heading-843238cb7c4b39b52e95311733ff6da6">
        
        
          
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2023/03/19/MySQL%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AE/" title="MySQL安装配置"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">MySQL安装配置</span>
        </a>
      
    
      
      
        <a href="/blog/2023/03/22/MySQL%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E5%85%A5%E5%9C%9F/" title="MySQL从入门到入土"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">MySQL从入门到入土</span>
        </a>
      
    
      
      
        <a href="/blog/2023/04/09/Java%E6%B3%9B%E5%9E%8B%E7%9A%84%E7%90%86%E8%A7%A3/" title="Java泛型：赋予灵活性的利器"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">Java泛型：赋予灵活性的利器</span>
        </a>
      
    
      
      
        <a href="/blog/2023/05/21/%E6%8E%A2%E7%B4%A2%20Python%20%E7%88%AC%E8%99%AB%E7%9A%84%E6%97%A0%E9%99%90%E5%8F%AF%E8%83%BD%E6%80%A7%EF%BC%9A%E5%9F%BA%E7%A1%80%E4%B8%8E%E5%BA%94%E7%94%A8/" title="探索Python爬虫的无限可能性：基础与应用"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">探索Python爬虫的无限可能性：基础与应用</span>
        </a>
      
    
      
      
        <a href="/blog/2023/06/03/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E7%9A%84%20JavaWeb%20%E4%B9%8B%E6%97%85/" title="从零开始的 JavaWeb 之旅"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">从零开始的 JavaWeb 之旅</span>
        </a>
      
    
      
      
        <a href="/blog/2023/06/10/%E6%95%B0%E6%8D%AE%E5%BA%93-%E5%AE%8C%E6%95%B4%E6%80%A7%E7%BA%A6%E6%9D%9F/" title="数据库-完整性约束"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">数据库-完整性约束</span>
        </a>
      
    
      
      
        <a href="/blog/2023/06/24/%E4%BD%BF%E7%94%A8%20JSP%20%E6%9E%84%E5%BB%BA%20JavaWeb%20%E9%A1%B9%E7%9B%AE-%E4%BB%A5%E6%95%B0%E6%8D%AE%E5%BA%93%E5%A4%A7%E4%BD%9C%E4%B8%9A%E4%B8%BA%E4%BE%8B/" title="使用JSP构建JavaWeb项目--以数据库大作业为例"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">使用JSP构建JavaWeb项目--以数据库大作业为例</span>
        </a>
      
    
      
      
        <a href="/blog/2023/07/06/%E6%89%93%E9%80%A0%E6%B5%81%E7%95%85%E7%BC%96%E7%A0%81%E4%B9%8B%E6%97%85%EF%BC%9AIntelliJ%20IDEA%20%E7%9A%84%E9%AB%98%E6%95%88%E4%BD%BF%E7%94%A8%E6%8A%80%E5%B7%A7%E4%B8%8E%E5%B7%A5%E4%BD%9C%E6%B5%81%E7%A8%8B%E4%BC%98%E5%8C%96/" title="打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化"
           class="list-group-item list-group-item-action
           active">
          <span class="category-post">打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化</span>
        </a>
      
    
      
      
        <a href="/blog/2023/07/06/%E5%87%A4%E5%87%B0%E6%B6%85%E6%A7%83%EF%BC%9ASpring%20Boot%20%E5%BC%80%E5%8F%91%E4%B9%8B%E8%B7%AF%E4%B8%8A%E7%9A%84%E5%9D%8E%E5%9D%B7%E4%B8%8E%E6%88%90%E9%95%BF/" title="凤凰涅槃：Spring Boot 开发之路上的坎坷与成长"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">凤凰涅槃：Spring Boot 开发之路上的坎坷与成长</span>
        </a>
      
    
      
      
        <a href="/blog/2023/07/11/%E4%BB%8EIP%E5%88%B0Ping%E5%91%BD%E4%BB%A4%EF%BC%9A%E4%BA%86%E8%A7%A3%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%E8%BF%9E%E6%8E%A5%E7%9A%84%E5%9F%BA%E7%A1%80/" title="从IP到Ping命令：了解计算机网络连接的基础"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">从IP到Ping命令：了解计算机网络连接的基础</span>
        </a>
      
    
      
      
        <a href="/blog/categories/%E4%BB%A3%E7%A0%81%E9%94%8B%E8%8A%92/" class="list-group-item list-group-item-action">
          <span class="category-post">More...</span>
        </a>
        
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="职路星火"
        id="heading-59c550454d1ecf67a2ead26a1c46d14b" role="tab" data-toggle="collapse" href="#collapse-59c550454d1ecf67a2ead26a1c46d14b"
        aria-expanded="false"
      >
        职路星火
        <span class="list-group-count">(2)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-59c550454d1ecf67a2ead26a1c46d14b"
           role="tabpanel" aria-labelledby="heading-59c550454d1ecf67a2ead26a1c46d14b">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2024/03/07/%E7%A0%BA%E5%89%91%E5%87%BA%E9%9E%98%EF%BC%9A%E6%88%91%E7%9A%84%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E5%B8%88%E6%B1%82%E8%81%8C%E4%B9%8B%E6%97%85/" title="砺剑出鞘：我的软件工程师求职之旅"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">砺剑出鞘：我的软件工程师求职之旅</span>
        </a>
      
    
      
      
        <a href="/blog/2024/04/16/%E6%8B%A8%E4%BA%91%E8%A7%81%E6%97%A5%EF%BC%9A%E8%81%8C%E5%9C%BA%E7%94%9F%E6%B4%BB%E7%9A%84%E7%82%B9%E6%BB%B4%E8%AE%B0%E5%BD%95/" title="拨云见日：职场生活的点滴记录"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">拨云见日：职场生活的点滴记录</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="部署之道"
        id="heading-36acf247b1a64f4bbe423776a392cfde" role="tab" data-toggle="collapse" href="#collapse-36acf247b1a64f4bbe423776a392cfde"
        aria-expanded="false"
      >
        部署之道
        <span class="list-group-count">(5)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-36acf247b1a64f4bbe423776a392cfde"
           role="tabpanel" aria-labelledby="heading-36acf247b1a64f4bbe423776a392cfde">
        
        
          
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2023/06/22/Nginx%20%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97%EF%BC%9A%E7%90%86%E8%A7%A3%E3%80%81%E9%85%8D%E7%BD%AE%E5%92%8C%E4%BC%98%E5%8C%96/" title="Nginx 入门指南：理解、配置和优化"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">Nginx 入门指南：理解、配置和优化</span>
        </a>
      
    
      
      
        <a href="/blog/2023/07/11/Docker%20%E5%85%A5%E9%97%A8%E4%B8%8E%E5%AE%9E%E8%B7%B5%EF%BC%9A%E5%BF%AB%E9%80%9F%E6%89%93%E9%80%A0%E9%AB%98%E6%95%88%E7%BD%91%E7%AB%99%E9%83%A8%E7%BD%B2%E7%8E%AF%E5%A2%83/" title="Docker入门与实践：快速打造高效网站部署环境"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">Docker入门与实践：快速打造高效网站部署环境</span>
        </a>
      
    
      
      
        <a href="/blog/2023/08/17/%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3%20API%20%E7%BD%91%E5%85%B3%EF%BC%9A%E5%8E%9F%E7%90%86%E3%80%81%E5%8A%9F%E8%83%BD%E5%92%8C%E7%94%A8%E9%80%94/" title="深入理解 API 网关：原理、功能和用途"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">深入理解 API 网关：原理、功能和用途</span>
        </a>
      
    
  </div>

          
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="职路星火"
        id="heading-59c550454d1ecf67a2ead26a1c46d14b" role="tab" data-toggle="collapse" href="#collapse-59c550454d1ecf67a2ead26a1c46d14b"
        aria-expanded="false"
      >
        职路星火
        <span class="list-group-count">(2)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-59c550454d1ecf67a2ead26a1c46d14b"
           role="tabpanel" aria-labelledby="heading-59c550454d1ecf67a2ead26a1c46d14b">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2024/12/16/%E6%BC%AB%E6%BC%AB%E5%BE%81%E9%80%94%EF%BC%9A%E7%AD%91%E6%A2%A6%E4%BA%8E%E8%81%8C%E5%9C%BA%E9%A3%8E%E9%9B%A8%EF%BC%8C%E5%90%9F%E5%92%8F%E4%BA%8E%E6%97%A5%E5%B8%B8%E8%AF%97%E6%84%8F/" title="漫漫征途：筑梦于职场风雨，吟咏于日常诗意"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">漫漫征途：筑梦于职场风雨，吟咏于日常诗意</span>
        </a>
      
    
      
      
        <a href="/blog/2025/10/23/%E4%BF%9D%E9%A9%BE%E6%8A%A4%E8%88%AA%E2%80%94%E2%80%94%E5%90%8E%E5%8F%B0%E8%BF%90%E7%BB%B4%E8%A7%86%E8%A7%92%E4%B8%8B%E7%9A%84%E9%AB%98%E9%80%9F%E5%85%AC%E8%B7%AF%E2%80%9C%E7%94%9F%E5%91%BD%E7%BA%BF%E2%80%9D/" title="保驾护航——后台运维视角下的高速公路“生命线”"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">保驾护航——后台运维视角下的高速公路“生命线”</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
        
      </div>
    </div>
  
    
    
    
    <div class="category-sub row nomargin-x">
      <a class="category-subitem collapsed
          list-group-item category-item-action col-10 col-md-11 col-xm-11" title="项目志录"
        id="heading-005e56101bc2a873707cb4461a70ded8" role="tab" data-toggle="collapse" href="#collapse-005e56101bc2a873707cb4461a70ded8"
        aria-expanded="false"
      >
        项目志录
        <span class="list-group-count">(1)</span>
        <i class="iconfont icon-arrowright"></i>
      </a>
      
      <div class="category-collapse collapse " id="collapse-005e56101bc2a873707cb4461a70ded8"
           role="tabpanel" aria-labelledby="heading-005e56101bc2a873707cb4461a70ded8">
        
        
          
  <div class="category-post-list">
    
    
      
      
        <a href="/blog/2023/07/30/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB%EF%BC%9A%E8%B8%A9%E5%9D%91%E6%8C%87%E5%8D%97%E4%B8%8E%E6%8A%80%E5%B7%A7%E6%80%BB%E7%BB%93/" title="小程序开发经验分享：踩坑指南与技巧总结"
           class="list-group-item list-group-item-action
           ">
          <span class="category-post">小程序开发经验分享：踩坑指南与技巧总结</span>
        </a>
      
    
  </div>

        
      </div>
    </div>
  
        
      </div>
    </div>
  
</div>

  </aside>


    </div>

    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化</h1>
            
              <p class="note note-success">
                
                  
                    本文最后更新于：5 个月前
                  
                
              </p>
            
            
              <div class="markdown-body">
                
                <h1 id="破冰"><a href="#破冰" class="headerlink" title="破冰"></a>破冰</h1><p>🍖 IntelliJ IDEA：一个不可或缺的利器</p>
<ul>
<li><p>提升开发效率的利器：IntelliJ IDEA 在 Java 开发领域的重要性</p>
</li>
<li><p>探索功能和特性：深入探索 IntelliJ IDEA 的强大功能和特性</p>
</li>
<li><p>打造流畅编码之旅：分享实用技巧和优化工作流程的方法</p>
</li>
<li><p>从新手到高手的成长之路：为读者提供宝贵经验和指导</p>
</li>
<li><p>从基础到高级：从配置和设置开始，逐步介绍常用功能和高级技巧</p>
</li>
<li><p>启程进入 IntelliJ IDEA 世界：探索其中的奇妙与无穷可能</p>
</li>
<li><p>适用于初学者和经验丰富的开发者：为你打开高效编码的大门</p>
</li>
<li><p>享受 Java 开发的旅程：让我们一同探索这个编程基石的奥妙</p>
</li>
</ul>
<h2 id="推荐阅读"><a href="#推荐阅读" class="headerlink" title="推荐阅读"></a>推荐阅读</h2><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/javaScript1997/article/details/127987452">【尚硅谷】IDEA2022 快速上手开发利器_java2022idea 怎么使用-CSDN 博客</a></p>
<p>两年前自定义过的 Java 代码模板：</p>
<p><img src="http://blog.memory-life.xyz/image-20240531180852935.png" alt="image-20240531180852935"></p>
<h1 id="思维碰撞"><a href="#思维碰撞" class="headerlink" title="思维碰撞"></a>思维碰撞</h1><h2 id="激活"><a href="#激活" class="headerlink" title="激活"></a>激活</h2><blockquote>
<p>2025 年 2 月 27 日</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://r86oxhhvu2.feishu.cn/docs/doccnpgDjY33Ly3IooYzAhenrn6">IDEA/PyCharm/DataGrip/Goland..等 JetBrains 激活方法汇总 - 飞书云文档 (feishu.cn)</a></p>
<p><a target="_blank" rel="noopener" href="https://r86oxhhvu2.feishu.cn/docx/doxcnsqHeJ7dbM6hF4LEmU0jaxe">JetBrains 全家桶激活 - 飞书云文档 (feishu.cn)</a></p>
<p>挺好用的教程，近两年来都是靠这个续命的，以防不久的将来可能会访问失败，现在把文中核心内容记录下来。</p>
<p>JetBrains 全家桶激活</p>
<p><strong>请尊重彼此的时间，认真看文档，不要再问文档中已经解决的问题</strong></p>
<p>文末【常见问题】中，总结了大家经常遇到的几个问题， 认真看文档！</p>
<p>本破解教程除了适用于 IDEA，同样适用于 JetBrains 全家桶，比如 PyCharm、DataGrip、Goland、WebStorm 等等</p>
<p><strong>本次工具支持 2021.3 以后版本（ 2021.3.1，2021.3.2，2021.3.3，2022.1，2022.1.1，2022.1.2，2022.1.3，2022.1.4，2022.2，2023.1,2023.2 等等）的 IDE 使用</strong></p>
<p>如果您是旧版本 IDEA（2021.2.2 及其之前版本），请官网下载新版本</p>
<p><strong>如果不想破解，嫌麻烦。可以找我朋友购买 1 年的官方正版授权，登录账号就可以使用：</strong></p>
<p><a target="_blank" rel="noopener" href="https://r86oxhhvu2.feishu.cn/docs/doccnsWPgI1VU54yMb7u6WkfzMg">JetBrains 官方正版账号，全家桶全版本全平台都可激活 _</a></p>
<p>以下为破解教程：</p>
<p>注意：</p>
<ul>
<li>适用于 IntelliJ IDEA <strong>2021.3 及其以上</strong>版本</li>
<li>同样适用于其他 JetBrains 产品，比如 PyCharm、DataGrip、Goland、WebStorm 等等</li>
<li><strong>适用于 Windows、Linux、Mac 等操作系统</strong></li>
</ul>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=MWU3ODg2Yjc5ZmM1OTMzNWEwNmYyNjdkOTM5YTk5NzRfTE1hYWJtNmVObEZyQzRCMkt6OUdaQXUwZ0JLQkpSdmJfVG9rZW46Ym94Y241bkZieTh6OE4wU2xhdFBna1EwbzFmXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p><strong>1. 清空 IDEA 以前的激活方法</strong></p>
<p>大家可能在网上找了很多破解方法，比如修改 Host 文件、修改 vmoptions 配置。安装了补丁插件。这些一定要都删除干净。不然可能会出现一些乱七八糟的问题。</p>
<p>如果没有破解过，直接看下一步。</p>
<p><strong>2. 下载激活脚本</strong></p>
<p><strong>破解补丁下载地址：</strong></p>
<p><a target="_blank" rel="noopener" href="https://r86oxhhvu2.feishu.cn/docx/doxcnsqHeJ7dbM6hF4LEmU0jaxe">JetBrains 全家桶激活 - 飞书云文档 (feishu.cn)</a></p>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=ZDJjYWFiMjdhZDZhMWQ3OGI4NDdhNGQ4YmMwN2I5ZGNfRWJ1QklDQUVadjEzdmlubm9qakJHZVZkUFM2MkpVdGZfVG9rZW46Ym94Y25UdG9rYUdNcTR5UEdhbVk2RWxTYU9lXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p>img</p>
<p>解释一下文件目录</p>
<ul>
<li>scripts： 这里存放了激活用到的脚本（windows、mac、linux 都有）</li>
<li>vmoptions：IDEA 关联的配置文件</li>
</ul>
<p><strong>注意： 此文件，放到一个安全稳定的位置，之后不要移动，更不要删除。并且路径不要出现中文</strong></p>
<p><strong>3. 运行激活脚本</strong></p>
<p>打开下载文件中的<code>scripts</code>文件，我们可以看到如下几个文件脚本</p>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=YTQyOGMyNTcwOTJjYmY0NmY2YjQzODljMmU5NWYwODJfR3NsNklqcTB0aHZvc1hudndrOWhFcVJkUUR1MG1JMFpfVG9rZW46Ym94Y24xSGZNN2FvcjlzdnBGMG12djg4VHliXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p>img</p>
<p>大家根据自己的操作系统执行对应的脚本</p>
<ul>
<li>Windows 系统： 双击运行 <code>install-current-user.vbs</code> 脚本，为当前用户安装破解补丁。<code>install-all-users.vbs</code>为所有系统用户安装，不过不太推荐</li>
<li>Mac、Linux 系统： 执行<code>install.sh</code> 脚本（Mac 注意给整个文件夹 777 权限）</li>
</ul>
<p>与之对应的<code>uninstall xxx</code>脚本就是卸载补丁的脚本</p>
<blockquote>
<p>因为脚本会添加一些配置文件，修改环境变量，所以会被杀毒软件误报，添加信任即可。如果你是在不放心是否安全，可以看一下脚本的源码。</p>
</blockquote>
<p><strong>建议先执行<code>uninstall xxxx</code>脚本，防止以前有过激活信息</strong></p>
<p>双击执行<code>install-xxx</code>补丁，我们会看到如下的弹窗，意思是：补丁运行可能需要几秒钟，点击确定，然后等待 Done 的提示框就可以</p>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=MWMwYTc1MGI5ZmZjOWE5YzViYjlhMWNkZDMyYmZiYjhfVFBDZG9WNFZOTXRYQWxqNHNzTEUzVUVnU3lhQ2JvMktfVG9rZW46Ym94Y25YdTdpb2R2WkpPNmR2d3IxdTkxdklkXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p>img</p>
<p>点击确定之后，耐心等待几秒钟或者十几秒。会出现下面的弹窗，代表补丁安装成功</p>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=N2I0NDk1MTc5Y2I0Yjk5ZjBlOGM0NTUxZGI5OWFlZTJfM1VhbFIxbG5xOW50Z3h0UWp2ckE0ZTZJaE1CczMwRVZfVG9rZW46Ym94Y25pcTAyV3dUcHl6WTFvTndFMEJCaW5mXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p>img</p>
<p><strong>4. 输入激活码</strong></p>
<p>运行完破解补丁之后，重启 IDEA，一定要重启 IDEA！</p>
<p><strong>激活码必须配合补丁使用才会有效！</strong></p>
<p>IDEA 激活码：</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs Plaintext">XIZQAN09CR-eyJsaWNlbnNlSWQiOiJYSVpRQU4wOUNSIiwibGljZW5zZWVOYW1lIjoia2lkZHkgaW5zZWFtcyIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IlBEQiIsImZhbGxiYWNrRGF0ZSI6IjIwMjUtMDgtMDEiLCJwYWlkVXBUbyI6IjIwMjUtMDgtMDEiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiUFNJIiwiZmFsbGJhY2tEYXRlIjoiMjAyNS0wOC0wMSIsInBhaWRVcFRvIjoiMjAyNS0wOC0wMSIsImV4dGVuZGVkIjp0cnVlfSx7ImNvZGUiOiJQUEMiLCJmYWxsYmFja0RhdGUiOiIyMDI1LTA4LTAxIiwicGFpZFVwVG8iOiIyMDI1LTA4LTAxIiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IlBDV01QIiwiZmFsbGJhY2tEYXRlIjoiMjAyNS0wOC0wMSIsInBhaWRVcFRvIjoiMjAyNS0wOC0wMSIsImV4dGVuZGVkIjp0cnVlfSx7ImNvZGUiOiJQUkIiLCJmYWxsYmFja0RhdGUiOiIyMDI1LTA4LTAxIiwicGFpZFVwVG8iOiIyMDI1LTA4LTAxIiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IlBQUyIsImZhbGxiYWNrRGF0ZSI6IjIwMjUtMDgtMDEiLCJwYWlkVXBUbyI6IjIwMjUtMDgtMDEiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiSUkiLCJmYWxsYmFja0RhdGUiOiIyMDI1LTA4LTAxIiwicGFpZFVwVG8iOiIyMDI1LTA4LTAxIiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJQR08iLCJmYWxsYmFja0RhdGUiOiIyMDI1LTA4LTAxIiwicGFpZFVwVG8iOiIyMDI1LTA4LTAxIiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IlBTVyIsImZhbGxiYWNrRGF0ZSI6IjIwMjUtMDgtMDEiLCJwYWlkVXBUbyI6IjIwMjUtMDgtMDEiLCJleHRlbmRlZCI6dHJ1ZX0seyJjb2RlIjoiUFdTIiwiZmFsbGJhY2tEYXRlIjoiMjAyNS0wOC0wMSIsInBhaWRVcFRvIjoiMjAyNS0wOC0wMSIsImV4dGVuZGVkIjp0cnVlfV0sIm1ldGFkYXRhIjoiMDEyMDIyMDgwMVBTQU4wMDAwMDUiLCJoYXNoIjoiVFJJQUw6LTEwMzUwMzQyMiIsImdyYWNlUGVyaW9kRGF5cyI6NywiYXV0b1Byb2xvbmdhdGVkIjpmYWxzZSwiaXNBdXRvUHJvbG9uZ2F0ZWQiOmZhbHNlfQ==-CoFOL4hCLVDFAdlOcxtyff4LA+HU4DIoRo+QTdjWbEuevzCGrh4ghKPWTCWT7YdMYoaaLGQfpR7DP8I2w4AxRMBH5T/KEUeNM70uTkdzIXboS460xZGLImtcte5hiD/U6k3P6NL2BVQgQwGTMRG5utlGdj1WtF/jb+yzp7+vaJiCt8uqqqXjEohapQsROTUihqtVRVkd9peAtS1gzKc39YEMnxu7Oggjuo797zMSnSswT5b4EVjgs+GJxL8RObb1o5xnKk8z4fCSRzVXD4tcVbwMXs/OVcr9+cgUYMiRCLhlHVOQJtb8F5r3IFYKFEPCPmwVAFHfmkMxC3uVmAcVsg==-MIIETDCCAjSgAwIBAgIBDTANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1KZXRQcm9maWxlIENBMB4XDTIwMTAxOTA5MDU1M1oXDTIyMTAyMTA5MDU1M1owHzEdMBsGA1UEAwwUcHJvZDJ5LWZyb20tMjAyMDEwMTkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCUlaUFc1wf+CfY9wzFWEL2euKQ5nswqb57V8QZG7d7RoR6rwYUIXseTOAFq210oMEe++LCjzKDuqwDfsyhgDNTgZBPAaC4vUU2oy+XR+Fq8nBixWIsH668HeOnRK6RRhsr0rJzRB95aZ3EAPzBuQ2qPaNGm17pAX0Rd6MPRgjp75IWwI9eA6aMEdPQEVN7uyOtM5zSsjoj79Lbu1fjShOnQZuJcsV8tqnayeFkNzv2LTOlofU/Tbx502Ro073gGjoeRzNvrynAP03pL486P3KCAyiNPhDs2z8/COMrxRlZW5mfzo0xsK0dQGNH3UoG/9RVwHG4eS8LFpMTR9oetHZBAgMBAAGjgZkwgZYwCQYDVR0TBAIwADAdBgNVHQ4EFgQUJNoRIpb1hUHAk0foMSNM9MCEAv8wSAYDVR0jBEEwP4AUo562SGdCEjZBvW3gubSgUouX8bOhHKQaMBgxFjAUBgNVBAMMDUpldFByb2ZpbGUgQ0GCCQDSbLGDsoN54TATBgNVHSUEDDAKBggrBgEFBQcDATALBgNVHQ8EBAMCBaAwDQYJKoZIhvcNAQELBQADggIBABqRoNGxAQct9dQUFK8xqhiZaYPd30TlmCmSAaGJ0eBpvkVeqA2jGYhAQRqFiAlFC63JKvWvRZO1iRuWCEfUMkdqQ9VQPXziE/BlsOIgrL6RlJfuFcEZ8TK3syIfIGQZNCxYhLLUuet2HE6LJYPQ5c0jH4kDooRpcVZ4rBxNwddpctUO2te9UU5/FjhioZQsPvd92qOTsV+8Cyl2fvNhNKD1Uu9ff5AkVIQn4JU23ozdB/R5oUlebwaTE6WZNBs+TA/qPj+5/we9NH71WRB0hqUoLI2AKKyiPw++FtN4Su1vsdDlrAzDj9ILjpjJKA1ImuVcG329/WTYIKysZ1CWK3zATg9BeCUPAV1pQy8ToXOq+RSYen6winZ2OO93eyHv2Iw5kbn1dqfBw1BuTE29V2FJKicJSu8iEOpfoafwJISXmz1wnnWL3V/0NxTulfWsXugOoLfv0ZIBP1xH9kmf22jjQ2JiHhQZP7ZDsreRrOeIQ/c4yR8IQvMLfC0WKQqrHu5ZzXTH4NO3CwGWSlTY74kE91zXB5mwWAx1jig+UXYc2w4RkVhy0//lOmVya/PEepuuTTI4+UJwC7qbVlh5zfhj8oTNUXgN0AOc+Q0/WFPl1aw5VV/VrO8FCoB15lFVlpKaQ1Yh+DVU8ke+rt9Th0BCHXe0uZOEmH0nOnH/0onD<br></code></pre></td></tr></table></figure>

<blockquote>
<p><strong>此激活码仅适用于 IDEA</strong></p>
</blockquote>
<p>其他软件激活码访问：<a target="_blank" rel="noopener" href="https://www.955code.com/8857.html">https://www.955code.com/8857.html</a></p>
<p>重启完毕之后，复制上方的激活码，粘贴到<code>Activation code</code>中，显示绿色就代表有效。然后点击<code>activate</code></p>
<p><strong>如果激活码显示灰色，并且确保破解补丁执行成功，可以重启电脑试试。</strong></p>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=NzhlNWRmNTQyMjg5MzA1MGY0MTEyNzBiMzZhYjZkMzhfNDJLM005QnZzUEU5OHpycVh6cFptUGUyWW9PNTk3S2dfVG9rZW46Ym94Y25aY3ZGaVg3SlF2R0hBUFNPU2FWQkloXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p>之后就看到成功激活到 2088 年了！</p>
<blockquote>
<h2 id="部分版本显示-2025-年，就是永久激活了！不用太在乎这个时间的。2025-也是永久激活"><a href="#部分版本显示-2025-年，就是永久激活了！不用太在乎这个时间的。2025-也是永久激活" class="headerlink" title="部分版本显示 2025 年，就是永久激活了！不用太在乎这个时间的。2025 也是永久激活"></a><strong>部分版本显示 2025 年，就是永久激活了！不用太在乎这个时间的。2025 也是永久激活</strong></h2></blockquote>
<p><img src="https://r86oxhhvu2.feishu.cn/space/api/box/stream/download/asynccode/?code=MTg5ZDg0NmMzOGMwMGY2OTM0YTI0YTVmYTg4ZTZjODlfd3RIR0wzQU1hdmpTTFZBdEY4YmhscmFXd2FDMjBpUUdfVG9rZW46Ym94Y25zTzlHY3ZlM1hKRHRUS29uMmUzb05kXzE3NDA2MjA0NjY6MTc0MDYyNDA2Nl9WNA" alt="img"></p>
<p><strong>5. 注意事项</strong></p>
<ul>
<li>脚本文件不要放在中文目录下。必须纯英文路径</li>
<li>适用于 2021.3 及以上几个版本。</li>
<li>如果重启 IDEA 还是无效，请重启电脑之后再输入激活码尝试</li>
<li>脚本文件中的任何一个文件都不要移动，也不要删除</li>
</ul>
<p><strong>常见问题</strong></p>
<p><strong>1）输入激活码后提示：“key is invalid”（无效 key），也就是激活码无效</strong></p>
<p>出现上面的情况后，一般都是工具没有生效，造成激活失败，请仔细看教程，是否遗漏了什么步骤。</p>
<p>也有小伙伴在尝试重启自己电脑后，激活成功。总之，没有激活成功问题比较多，大家可以按其他小伙伴的方式尝试下。</p>
<p><strong>激活须知（必读）</strong></p>
<p>1.本次工具支持 2021.3 以后版本（ <strong>2021.3.1</strong>，<strong>2021.3.2</strong>，<strong>2021.3.3，2022.1，2022.1.1，2022.1.2，2022.1.3，2022.1.4，2022.2</strong>）的 IDE 使用，请先确认自己 IDE 版本，其他版本请看这个：<a target="_blank" rel="noopener" href="https://www.955code.com/2906.html">https://www.955code.com/2906.html</a></p>
<p>2.激活前，需退出个人的 JB 账号，如果之前激活过，请先执行卸载脚本 uninstall，在执行安装脚本 install</p>
<p>3.激活工具下载后，<strong>存放路径不能有空格和汉字</strong>，并记得要先解压，否则激活失败，提示：“ja-netfilter.jar not found”,（部分 Windows 用户隐藏了文件后缀名，也会出现找不到 jar 文件的情况，可以把隐藏的后缀名打开；也有小伙伴是因为文件在微信上接收后，直接操作，那样用户是没有权限的，所以也会提示错误，请创建一个文件夹并移动工具过去）；如果提示无法解压，请先安装 zip 解压工具；激活成功后，不要移动工具位置，更不要删除工具，否则 IDE 会无法启动。</p>
<p>4.如果之前有破解过，本次想要更新 IDE，同时之前破解使用的其他破解工具，需要先删除，并彻底删除**<em>idea.64.vmoptions</em>**下工具配置信息</p>
<p>5.激活后，本工具不会对激活的时间做更改，也不会显示 2099，但不影响使用，所以不必在意时间</p>
<p>6.该激活工具支持 Jetbrains 家族下所有 IDE（如：IntelliJ IDEA、Pycharm、WebStorm、PHPStorm、GoLand、DataGrip 等），同时，支持**<em>Windows，Linux，Mac</em>**下使用。</p>
<p>7.如果激活后，进入 IDE 就退出，提示激活码失效，说明激活工具没有生效，本次激活失败，可以<strong>先执行卸载脚本</strong>，在执行安装脚本，最后<strong>尝试重启电脑(尤其是 Mac 用户，建议执行完脚本重启一下电脑)</strong>…</p>
<p>执行脚本提示权限不足</p>
<p>说明下载工具的用户和执行脚本的用户，不是同一个用户，切换一下用户就可以了</p>
<p>执行脚本，没有出现“Done”</p>
<p>如果本地文件和 IDE 过多，需要耐心等待下，执行时间会比较长，有时候大概 5-10 分钟，甚至半个小时。</p>
<p>“ja-netfilter.jar not found”</p>
<p><strong>请先解压激活工具</strong>，如果已经解压，仍提示，请先确认下是否安装 JDK 环境，另外，部分 Windows 用户隐藏了文件后缀名，也会出现“ja-netfilter.jar not found”的情况，可以<strong>把隐藏的后缀名打开</strong></p>
<h2 id="使用技巧"><a href="#使用技巧" class="headerlink" title="使用技巧"></a>使用技巧</h2><blockquote>
<p>2024 年 5 月 13 日</p>
</blockquote>
<p>下载最新版本 IDEA，2023 版本的，激活。</p>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/weixin_50737119/article/details/135628513">IDEA2023 的激活与安装（全网最靠谱，最快捷的方式）_idea 激活-CSDN 博客</a></p>
<p><a target="_blank" rel="noopener" href="https://www.ajihuo.com/idea/5937.html">IDEA 激活码,IDEA 激活码 2022,IDEA 永久激活码_IDEA 激活码 2022 和 2023IDEA 激活码,IDEA 激活码 2022,IDEA 激活码 2023,IDEA 注册码,IDEA 永久破解,Pycharm 激活码,Webstorm 激活码 (ajihuo.com)</a></p>
<h2 id=""><a href="#" class="headerlink" title=""></a><img src="http://blog.memory-life.xyz/image-20240513233303562.png" alt="image-20240513233303562"></h2><p><img src="http://blog.memory-life.xyz/image-20240513234203923.png" alt="image-20240513234203923"></p>
<h3 id="常用快捷键"><a href="#常用快捷键" class="headerlink" title="常用快捷键"></a>常用快捷键</h3><ul>
<li><h5 id="Ctrl-S：保存"><a href="#Ctrl-S：保存" class="headerlink" title="Ctrl + S：保存"></a>Ctrl + S：保存</h5></li>
<li><h5 id="Ctrl-A：全选"><a href="#Ctrl-A：全选" class="headerlink" title="Ctrl + A：全选"></a>Ctrl + A：全选</h5></li>
<li><h5 id="Ctrl-F：当前页面搜索"><a href="#Ctrl-F：当前页面搜索" class="headerlink" title="Ctrl + F：当前页面搜索"></a>Ctrl + F：当前页面搜索</h5></li>
<li><h5 id="Ctrl-Shift-R-双击-shift：全局搜索"><a href="#Ctrl-Shift-R-双击-shift：全局搜索" class="headerlink" title="Ctrl + Shift + R / 双击 shift：全局搜索"></a>Ctrl + Shift + R / 双击 shift：全局搜索</h5></li>
</ul>
<h3 id="多端口启动项目"><a href="#多端口启动项目" class="headerlink" title="多端口启动项目"></a>多端口启动项目</h3><ul>
<li><h5 id="在使用-IDEA-作-Java-Spring-全家桶框架后端开发时，经常要多端口跑项目，那么借助-IDEA，这种操作怎样实现呢？"><a href="#在使用-IDEA-作-Java-Spring-全家桶框架后端开发时，经常要多端口跑项目，那么借助-IDEA，这种操作怎样实现呢？" class="headerlink" title="在使用 IDEA 作 Java + Spring 全家桶框架后端开发时，经常要多端口跑项目，那么借助 IDEA，这种操作怎样实现呢？"></a>在使用 IDEA 作 Java + Spring 全家桶框架后端开发时，经常要多端口跑项目，那么借助 IDEA，这种操作怎样实现呢？</h5></li>
<li><h5 id="最近在学习-SpringCloud-微服务，就拿其中一个微服务来演示吧"><a href="#最近在学习-SpringCloud-微服务，就拿其中一个微服务来演示吧" class="headerlink" title="最近在学习 SpringCloud 微服务，就拿其中一个微服务来演示吧"></a>最近在学习 SpringCloud 微服务，就拿其中一个微服务来演示吧</h5></li>
<li><h5 id="首先，运行-UserService-服务："><a href="#首先，运行-UserService-服务：" class="headerlink" title="首先，运行 UserService 服务："></a>首先，运行 UserService 服务：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230715150128360.png" alt="image-20230715150128360"></p>
<ul>
<li><h5 id="如上图所示，该服务已在-8099-端口运行"><a href="#如上图所示，该服务已在-8099-端口运行" class="headerlink" title="如上图所示，该服务已在 8099 端口运行"></a>如上图所示，该服务已在 8099 端口运行</h5></li>
<li><h5 id="接下来我们就要实现多端口运行-UserService-服务了"><a href="#接下来我们就要实现多端口运行-UserService-服务了" class="headerlink" title="接下来我们就要实现多端口运行 UserService 服务了"></a>接下来我们就要实现多端口运行 UserService 服务了</h5></li>
<li><h5 id="复制一份-UserService-服务运行实例："><a href="#复制一份-UserService-服务运行实例：" class="headerlink" title="复制一份 UserService 服务运行实例："></a>复制一份 UserService 服务运行实例：</h5></li>
</ul>
<img src="http://blog.memory-life.xyz/image-20230715150352424.png" alt="image-20230715150352424" style="zoom:150%;" />

<ul>
<li><h5 id="在弹窗中指定服务名称，并配置启动端口号："><a href="#在弹窗中指定服务名称，并配置启动端口号：" class="headerlink" title="在弹窗中指定服务名称，并配置启动端口号："></a>在弹窗中指定服务名称，并配置启动端口号：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230715150618730.png" alt="image-20230715150618730"></p>
<figure class="highlight elm"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs elm">-<span class="hljs-type">Dserver</span>.<span class="hljs-keyword">port</span>=7099<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="点击确认，在-Not-Started-下-即可找到复制后的服务："><a href="#点击确认，在-Not-Started-下-即可找到复制后的服务：" class="headerlink" title="点击确认，在 Not Started 下 即可找到复制后的服务："></a>点击确认，在 Not Started 下 即可找到复制后的服务：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230715150755974.png" alt="image-20230715150755974"></p>
<ul>
<li><h5 id="启动该服务，即可看到-User-在-7099-端口成功运行了："><a href="#启动该服务，即可看到-User-在-7099-端口成功运行了：" class="headerlink" title="启动该服务，即可看到 User 在 7099 端口成功运行了："></a>启动该服务，即可看到 User 在 7099 端口成功运行了：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230715150951551.png" alt="image-20230715150951551"></p>
<ul>
<li><h5 id="这就是-IDEA-工具中多端口运行服务的方法"><a href="#这就是-IDEA-工具中多端口运行服务的方法" class="headerlink" title="这就是 IDEA 工具中多端口运行服务的方法"></a>这就是 IDEA 工具中多端口运行服务的方法</h5></li>
</ul>
<h3 id="SpringBoot-版本与-JDK-版本不兼容"><a href="#SpringBoot-版本与-JDK-版本不兼容" class="headerlink" title="SpringBoot 版本与 JDK 版本不兼容"></a>SpringBoot 版本与 JDK 版本不兼容</h3><ul>
<li><h5 id="今天新构建了一个新的-SpringBoot-项目模板，启动项目时报错："><a href="#今天新构建了一个新的-SpringBoot-项目模板，启动项目时报错：" class="headerlink" title="今天新构建了一个新的 SpringBoot 项目模板，启动项目时报错："></a>今天新构建了一个新的 SpringBoot 项目模板，启动项目时报错：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230728224936670.png" alt="image-20230728224936670"></p>
<ul>
<li><h5 id="该项目使用的-SpringBoot-版本为-3-1-2，JDK-版本为-11，"><a href="#该项目使用的-SpringBoot-版本为-3-1-2，JDK-版本为-11，" class="headerlink" title="该项目使用的 SpringBoot 版本为 3.1.2，JDK 版本为 11，"></a>该项目使用的 SpringBoot 版本为 3.1.2，JDK 版本为 11，</h5></li>
<li><h5 id="在将-SpringBoot-版本降为-2-7-9-后，项目启动成功了（2023-07-28-晚）"><a href="#在将-SpringBoot-版本降为-2-7-9-后，项目启动成功了（2023-07-28-晚）" class="headerlink" title="在将 SpringBoot 版本降为 2.7.9 后，项目启动成功了（2023/07/28 晚）"></a>在将 SpringBoot 版本降为 2.7.9 后，项目启动成功了（2023/07/28 晚）</h5></li>
</ul>
<h3 id="模拟浏览器发送请求"><a href="#模拟浏览器发送请求" class="headerlink" title="模拟浏览器发送请求"></a>模拟浏览器发送请求</h3><ul>
<li><h5 id="我们在开发过程中，在后台编写好模拟简单的接口后，总是要在网页上输入对应-url，测试该接口能否跑通"><a href="#我们在开发过程中，在后台编写好模拟简单的接口后，总是要在网页上输入对应-url，测试该接口能否跑通" class="headerlink" title="我们在开发过程中，在后台编写好模拟简单的接口后，总是要在网页上输入对应 url，测试该接口能否跑通"></a>我们在开发过程中，在后台编写好模拟简单的接口后，总是要在网页上输入对应 url，测试该接口能否跑通</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230729000307955.png" alt="image-20230729000307955"></p>
<ul>
<li><h5 id="然而-IDEA-给我们提供了模拟网页请求的功能：（2023-07-28-晚）"><a href="#然而-IDEA-给我们提供了模拟网页请求的功能：（2023-07-28-晚）" class="headerlink" title="然而 IDEA 给我们提供了模拟网页请求的功能：（2023/07/28 晚）"></a>然而 IDEA 给我们提供了模拟网页请求的功能：（2023/07/28 晚）</h5></li>
<li><p>如图所示：</p>
</li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20230814114805240.png" alt="image-20230814114805240"></p>
<ul>
<li><h5 id="在该页面下，我们可以快速编写-HTTP-请求，POST-或-GET："><a href="#在该页面下，我们可以快速编写-HTTP-请求，POST-或-GET：" class="headerlink" title="在该页面下，我们可以快速编写 HTTP 请求，POST 或 GET："></a>在该页面下，我们可以快速编写 HTTP 请求，POST 或 GET：</h5></li>
</ul>
<figure class="highlight http"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs http">GET http://localhost:80/api/item?id=99<br><span class="hljs-attribute">Accept</span><span class="hljs-punctuation">: </span>application/json<br><br>POST http://localhost:80/api/item<br><span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/x-www-form-urlencoded<br><br>id=99&amp;content=new-element<br><br>###<br>POST http://localhost:80/api/item<br><span class="hljs-attribute">Content-Type</span><span class="hljs-punctuation">: </span>application/json<br><br>&#123;&#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="有关如何正确处理-HTTP-请求中的参数的问题，日后会更新（2023-08-14-午）"><a href="#有关如何正确处理-HTTP-请求中的参数的问题，日后会更新（2023-08-14-午）" class="headerlink" title="有关如何正确处理 HTTP 请求中的参数的问题，日后会更新（2023/08/14 午）"></a>有关如何正确处理 HTTP 请求中的参数的问题，日后会更新（2023/08/14 午）</h5></li>
<li><h5 id="这部分内容-👆-已经在《SpringBoot-配置》中的-SpringMVC-栏目下完成了（2023-10-05-晚）"><a href="#这部分内容-👆-已经在《SpringBoot-配置》中的-SpringMVC-栏目下完成了（2023-10-05-晚）" class="headerlink" title="这部分内容 👆 已经在《SpringBoot 配置》中的 SpringMVC 栏目下完成了（2023/10/05 晚）"></a>这部分内容 👆 已经在《SpringBoot 配置》中的 SpringMVC 栏目下完成了（2023/10/05 晚）</h5></li>
<li><h5 id="不仅如此，我们还可以在编写完成-controller-层接口后，模拟浏览器发送请求，快速测试："><a href="#不仅如此，我们还可以在编写完成-controller-层接口后，模拟浏览器发送请求，快速测试：" class="headerlink" title="不仅如此，我们还可以在编写完成 controller 层接口后，模拟浏览器发送请求，快速测试："></a>不仅如此，我们还可以在编写完成 controller 层接口后，模拟浏览器发送请求，快速测试：</h5></li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20230814122848595.png" alt="image-20230814122848595"></p>
<ul>
<li><h5 id="这部分的实际运用，可以在《快速启动：开发自己的定制化-Spring-Boot-项目模板》一文中的-快速编写-Controller-层-栏目中了解到（2023-08-14-午）"><a href="#这部分的实际运用，可以在《快速启动：开发自己的定制化-Spring-Boot-项目模板》一文中的-快速编写-Controller-层-栏目中了解到（2023-08-14-午）" class="headerlink" title="这部分的实际运用，可以在《快速启动：开发自己的定制化-Spring-Boot-项目模板》一文中的 快速编写 Controller 层 栏目中了解到（2023/08/14 午）"></a>这部分的实际运用，可以在《快速启动：开发自己的定制化-Spring-Boot-项目模板》一文中的 快速编写 Controller 层 栏目中了解到（2023/08/14 午）</h5></li>
</ul>
<h3 id="快速新建-demo"><a href="#快速新建-demo" class="headerlink" title="快速新建 demo"></a>快速新建 demo</h3><ul>
<li><p>如何使用 IDEA 快速新建一个 demo，测试简单的代码？</p>
</li>
<li><p>相信长时间依赖 Maven 快速构建 Spring Boot 项目，已经对这种构建简单的项目有些生疏了</p>
</li>
<li><h5 id="使用-IDEA-构建-demo-的流程如下：（2023-08-14-早）"><a href="#使用-IDEA-构建-demo-的流程如下：（2023-08-14-早）" class="headerlink" title="使用 IDEA 构建 demo 的流程如下：（2023/08/14 早）"></a>使用 IDEA 构建 demo 的流程如下：（2023/08/14 早）</h5><ul>
<li>新建 Project</li>
<li>新建空项目</li>
</ul>
</li>
<li><p>如图所示：</p>
</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230814105219120.png" alt="image-20230814105219120"></p>
<p><img src="http://blog.memory-life.xyz/image-20230814105457520.png" alt="image-20230814105457520"></p>
<ul>
<li><p>这里 👆 新建空项目就行，清爽</p>
</li>
<li><h5 id="如果有遇到不能新建-java-文件的问题，在对应包右键菜单中如此操作："><a href="#如果有遇到不能新建-java-文件的问题，在对应包右键菜单中如此操作：" class="headerlink" title="如果有遇到不能新建 java 文件的问题，在对应包右键菜单中如此操作："></a>如果有遇到不能新建 java 文件的问题，在对应包右键菜单中如此操作：</h5><ul>
<li>Mark Directory as</li>
<li>Sourse Root</li>
</ul>
</li>
<li><h5 id="依次执行完这两步操作，就可以正常新增-java-文件了（2023-08-14-早）"><a href="#依次执行完这两步操作，就可以正常新增-java-文件了（2023-08-14-早）" class="headerlink" title="依次执行完这两步操作，就可以正常新增 java 文件了（2023/08/14 早）"></a>依次执行完这两步操作，就可以正常新增 java 文件了（2023/08/14 早）</h5></li>
<li><p>详细操作可以看这篇博客：<a target="_blank" rel="noopener" href="https://blog.csdn.net/wukunyan777/article/details/128660908">idea 不能建 java 文件的解决方法<em>idea 无法新建 java 文件</em>和小九的岁岁年年的博客-CSDN 博客</a></p>
</li>
</ul>
<h3 id="快速构建-Spring-Boot-项目"><a href="#快速构建-Spring-Boot-项目" class="headerlink" title="快速构建 Spring Boot 项目"></a>快速构建 Spring Boot 项目</h3><ul>
<li>随着 <code>JDK 21</code> 的发布，IDEA 中的构建 Spring Boot 项目也发生了变化：</li>
<li>现在构建新项目，可以看到可选的 JDK 版本只有两个：<code>JDK 17</code> 和 <code>JDK 21</code>：</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20231216115258616.png" alt="image-20231216115258616"></p>
<ul>
<li>由于可选的 <code>Spring Boot</code> 版本只有 <code>3.x.x</code> 版本，且 <code>Spring Boot 3</code> 明确宣布只支持 <code>JDK 17</code> 及以上的版本<strong>（2023/12/16 午）</strong></li>
<li>所以新项目如果需要和之前低版本的 <code>Spring Boot</code> 项目合作，就会报错：<strong>不支持发行的 17 版本</strong></li>
<li>这就需要我们更旧项目的 <code>JDK</code> 版本了：</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20231216115138405.png" alt="image-20231216115138405"></p>
<h3 id="导入模块"><a href="#导入模块" class="headerlink" title="导入模块"></a>导入模块</h3><ul>
<li><h5 id="在-IDEA-中，如何在一个项目中导入一个模块？（2023-08-14-早）"><a href="#在-IDEA-中，如何在一个项目中导入一个模块？（2023-08-14-早）" class="headerlink" title="在 IDEA 中，如何在一个项目中导入一个模块？（2023/08/14 早）"></a>在 IDEA 中，如何在一个项目中导入一个模块？（2023/08/14 早）</h5></li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20230814115941831.png" alt="image-20230814115941831"></p>
<ul>
<li><h5 id="选择要导入的模块后，会弹出选项，选择第一个："><a href="#选择要导入的模块后，会弹出选项，选择第一个：" class="headerlink" title="选择要导入的模块后，会弹出选项，选择第一个："></a>选择要导入的模块后，会弹出选项，选择第一个：</h5></li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20230814120251967.png" alt="image-20230814120251967"></p>
<ul>
<li><h5 id="没有特殊要求，无脑-next-就可以了，模块导入成功（2023-08-14-早）"><a href="#没有特殊要求，无脑-next-就可以了，模块导入成功（2023-08-14-早）" class="headerlink" title="没有特殊要求，无脑 next 就可以了，模块导入成功（2023/08/14 早）"></a>没有特殊要求，无脑 next 就可以了，模块导入成功（2023/08/14 早）</h5></li>
<li><p>详细步骤可以参考这篇博客：<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_48290779/article/details/129758653">如何在 IDEA 中导入一个模块<em>idea 导入模块</em>驱动男孩的博客-CSDN 博客</a></p>
</li>
</ul>
<h3 id="定时任务实现"><a href="#定时任务实现" class="headerlink" title="定时任务实现"></a>定时任务实现</h3><ul>
<li><p>思来想去，这个栏目还是写在这儿比较合适，介绍一下在 Java 中，如何写一个<strong>定时任务</strong></p>
</li>
<li><h5 id="推荐阅读：我终于会写-Java-的定时任务了！-掘金-juejin-cn"><a href="#推荐阅读：我终于会写-Java-的定时任务了！-掘金-juejin-cn" class="headerlink" title="推荐阅读：我终于会写 Java 的定时任务了！ - 掘金 (juejin.cn)"></a>推荐阅读：<a target="_blank" rel="noopener" href="https://juejin.cn/post/7158851405531316254">我终于会写 Java 的定时任务了！ - 掘金 (juejin.cn)</a></h5></li>
</ul>
<h4 id="纯手写单线程循环"><a href="#纯手写单线程循环" class="headerlink" title="纯手写单线程循环"></a>纯手写单线程循环</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">timer1</span><span class="hljs-params">()</span> &#123;<br>     <span class="hljs-keyword">new</span> <span class="hljs-title class_">Thread</span>(() -&gt; &#123;<br>         <span class="hljs-keyword">while</span> (<span class="hljs-literal">true</span>) &#123;<br>             System.out.println(<span class="hljs-string">&quot;定时任务A 当前时间: &quot;</span> + LocalDateTime.now());<br>             <span class="hljs-keyword">try</span> &#123;<br>                 Thread.sleep(<span class="hljs-number">1000</span>);<br>             &#125; <span class="hljs-keyword">catch</span> (InterruptedException e) &#123;<br>                 <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">RuntimeException</span>(e);<br>             &#125;<br>         &#125;<br>     &#125;).start();<br> &#125;<br></code></pre></td></tr></table></figure>

<h4 id="Timer-和他的小伙伴"><a href="#Timer-和他的小伙伴" class="headerlink" title="Timer 和他的小伙伴"></a>Timer 和他的小伙伴</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">timer2</span><span class="hljs-params">()</span> &#123;<br>        <span class="hljs-comment">// 单线程</span><br>        <span class="hljs-type">Timer</span> <span class="hljs-variable">timer</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Timer</span>();<br>        System.out.println(<span class="hljs-string">&quot;1秒后执行任务A，A完成后，等待1秒开始定时执行任务B，当前时间: &quot;</span> + LocalDateTime.now());<br>        <span class="hljs-comment">// 1秒后执行</span><br>        timer.schedule(<span class="hljs-keyword">new</span> <span class="hljs-title class_">TimerTask</span>() &#123;<br>            <span class="hljs-meta">@Override</span><br>            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">run</span><span class="hljs-params">()</span> &#123;<br>                System.out.println(<span class="hljs-string">&quot;定时任务A 当前时间: &quot;</span> + LocalDateTime.now());<br>            &#125;<br>        &#125;, <span class="hljs-number">1000</span>); <span class="hljs-comment">// 这里 1000，就是代表延迟 1000 毫秒后再执行</span><br><br>        <span class="hljs-comment">// 每隔2秒执行一次这个任务</span><br>        timer.schedule(<span class="hljs-keyword">new</span> <span class="hljs-title class_">TimerTask</span>() &#123;<br>            <span class="hljs-meta">@Override</span><br>            <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">run</span><span class="hljs-params">()</span> &#123;<br>                System.out.println(<span class="hljs-string">&quot;定时任务B 当前时间: &quot;</span> + LocalDateTime.now());<br>            &#125;<br>        &#125;, <span class="hljs-number">1000</span>, <span class="hljs-number">2000</span>); <span class="hljs-comment">// 1000 同理，2000 即执行完本次任务后，隔 2000 毫秒后再一次执行，达到定时任务的效果</span><br>    &#125;<br></code></pre></td></tr></table></figure>

<h4 id="ScheduledExecutorService"><a href="#ScheduledExecutorService" class="headerlink" title="ScheduledExecutorService"></a>ScheduledExecutorService</h4><ul>
<li><h5 id="定时执行"><a href="#定时执行" class="headerlink" title="定时执行"></a>定时执行</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">timer4</span><span class="hljs-params">()</span> &#123;<br>        <span class="hljs-type">ScheduledExecutorService</span> <span class="hljs-variable">scheduledExecutorService</span> <span class="hljs-operator">=</span> Executors.newSingleThreadScheduledExecutor();<br>        System.out.println(<span class="hljs-string">&quot;2秒后开始执行任务，此刻时间---&quot;</span> + LocalDateTime.now());<br>        <span class="hljs-comment">// 固定频率（每隔5秒）开始执行一个任务</span><br>        scheduledExecutorService.scheduleAtFixedRate(() -&gt; &#123;<br>            System.out.println(<span class="hljs-string">&quot;任务开始---&quot;</span> + LocalDateTime.now());<br>            <span class="hljs-keyword">try</span> &#123;<br>                Thread.sleep(<span class="hljs-number">2000</span>);<br>            &#125; <span class="hljs-keyword">catch</span> (InterruptedException e) &#123;<br>                e.printStackTrace();<br>            &#125;<br>            System.out.println(<span class="hljs-string">&quot;任务结束---&quot;</span> + LocalDateTime.now());<br>        &#125;, <span class="hljs-number">2000</span>, <span class="hljs-number">5000</span>, TimeUnit.MILLISECONDS);<br>    &#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="延时执行"><a href="#延时执行" class="headerlink" title="延时执行"></a>延时执行</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">timer5</span><span class="hljs-params">()</span> &#123;<br>        <span class="hljs-type">ScheduledExecutorService</span> <span class="hljs-variable">scheduledExecutorService</span> <span class="hljs-operator">=</span> Executors.newSingleThreadScheduledExecutor();<br>        System.out.println(<span class="hljs-string">&quot;2秒后开始执行任务，此刻时间---&quot;</span> + LocalDateTime.now());<br>        <span class="hljs-comment">// 任务完成后间隔4秒开始执行下一次任务</span><br>        scheduledExecutorService.scheduleWithFixedDelay(() -&gt; &#123;<br>            System.out.println(<span class="hljs-string">&quot;任务开始---&quot;</span> + LocalDateTime.now());<br>            <span class="hljs-keyword">try</span> &#123;<br>                Thread.sleep(<span class="hljs-number">2000</span>);<br>            &#125; <span class="hljs-keyword">catch</span> (InterruptedException e) &#123;<br>                e.printStackTrace();<br>            &#125;<br>            System.out.println(<span class="hljs-string">&quot;任务结束---&quot;</span> + LocalDateTime.now());<br>        &#125;, <span class="hljs-number">2000</span>, <span class="hljs-number">4000</span>, TimeUnit.MILLISECONDS);<br>    &#125;<br></code></pre></td></tr></table></figure>

<h4 id="DelayQueue-延迟任务"><a href="#DelayQueue-延迟任务" class="headerlink" title="DelayQueue 延迟任务"></a>DelayQueue 延迟任务</h4><ul>
<li><h5 id="DelayQueue-是-JDK-提供的-api，是一个延迟队列"><a href="#DelayQueue-是-JDK-提供的-api，是一个延迟队列" class="headerlink" title="DelayQueue 是 JDK 提供的 api，是一个延迟队列"></a>DelayQueue 是 JDK 提供的 api，是一个延迟队列</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@Slf4j</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">DelayQueueDemo</span> &#123;<br><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">main</span><span class="hljs-params">(String[] args)</span> &#123;<br>        DelayQueue&lt;SanYouTask&gt; sanYouTaskDelayQueue = <span class="hljs-keyword">new</span> <span class="hljs-title class_">DelayQueue</span>&lt;&gt;();<br><br>        <span class="hljs-keyword">new</span> <span class="hljs-title class_">Thread</span>(() -&gt; &#123;<br>            <span class="hljs-keyword">while</span> (<span class="hljs-literal">true</span>) &#123;<br>                <span class="hljs-keyword">try</span> &#123;<br>                    <span class="hljs-type">SanYouTask</span> <span class="hljs-variable">sanYouTask</span> <span class="hljs-operator">=</span> sanYouTaskDelayQueue.take();<br>                    log.info(<span class="hljs-string">&quot;获取到延迟任务:&#123;&#125;&quot;</span>, sanYouTask.getTaskContent());<br>                &#125; <span class="hljs-keyword">catch</span> (Exception e) &#123;<br>                &#125;<br>            &#125;<br>        &#125;).start();<br><br>        log.info(<span class="hljs-string">&quot;提交延迟任务&quot;</span>);<br>        sanYouTaskDelayQueue.offer(<span class="hljs-keyword">new</span> <span class="hljs-title class_">SanYouTask</span>(<span class="hljs-string">&quot;三友的java日记5s&quot;</span>, <span class="hljs-number">5L</span>));<br>        sanYouTaskDelayQueue.offer(<span class="hljs-keyword">new</span> <span class="hljs-title class_">SanYouTask</span>(<span class="hljs-string">&quot;三友的java日记3s&quot;</span>, <span class="hljs-number">3L</span>));<br>        sanYouTaskDelayQueue.offer(<span class="hljs-keyword">new</span> <span class="hljs-title class_">SanYouTask</span>(<span class="hljs-string">&quot;三友的java日记8s&quot;</span>, <span class="hljs-number">8L</span>));<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-meta">@Data</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">SanYouTask</span> <span class="hljs-keyword">implements</span> <span class="hljs-title class_">Delayed</span> &#123;<br><br>    <span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> String taskContent;<br><br>    <span class="hljs-keyword">private</span> <span class="hljs-keyword">final</span> Long triggerTime;<br><br>    <span class="hljs-keyword">public</span> <span class="hljs-title function_">SanYouTask</span><span class="hljs-params">(String taskContent, Long delayTime)</span> &#123;<br>        <span class="hljs-built_in">this</span>.taskContent = taskContent;<br>        <span class="hljs-built_in">this</span>.triggerTime = System.currentTimeMillis() + delayTime * <span class="hljs-number">1000</span>;<br>    &#125;<br><br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-type">long</span> <span class="hljs-title function_">getDelay</span><span class="hljs-params">(TimeUnit unit)</span> &#123;<br>        <span class="hljs-keyword">return</span> unit.convert(triggerTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS);<br>    &#125;<br><br>    <span class="hljs-meta">@Override</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-type">int</span> <span class="hljs-title function_">compareTo</span><span class="hljs-params">(Delayed o)</span> &#123;<br>            <span class="hljs-keyword">return</span> <span class="hljs-built_in">this</span>.triggerTime.compareTo(((SanYouTask) o).triggerTime);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><code>getDelay</code>方法返回<strong>这个任务还剩多久时间可以执行</strong>，小于 0 的时候说明可以这个延迟任务到了执行的时间了。</li>
<li><code>compareTo</code>这个是<strong>对任务排序</strong>的，保证最先到延迟时间的任务排到队列的头。<ul>
<li><strong>taskContent</strong>：延迟任务的具体的内容</li>
<li><strong>delayTime</strong>：延迟时间，秒为单位</li>
</ul>
</li>
</ul>
<h5 id="实现原理"><a href="#实现原理" class="headerlink" title="实现原理"></a>实现原理</h5><blockquote>
<p>🍻 <code>offer</code>方法在提交任务的时候，会通过根据<code>compareTo</code>的实现对任务进行排序，将最先需要被执行的任务放到队列头。</p>
<p>🍛<code>take</code>方法获取任务的时候，会拿到队列头部的元素，也就是队列中最早需要被执行的任务，通过 getDelay 返回值判断任务是否需要被立刻执行，如果需要的话，就返回任务，如果不需要就会等待这个任务到延迟时间的剩余时间，当时间到了就会将任务返回。</p>
</blockquote>
<ul>
<li>效果如下：</li>
</ul>
<h4 id="Spring-提供定时任务"><a href="#Spring-提供定时任务" class="headerlink" title="Spring 提供定时任务"></a>Spring 提供定时任务</h4><figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@author</span> 邓哈哈</span><br><span class="hljs-comment"> * 2023/8/29 11:50</span><br><span class="hljs-comment"> * Function:</span><br><span class="hljs-comment"> * Version 1.0</span><br><span class="hljs-comment"> */</span><br><br><span class="hljs-meta">@EnableScheduling</span><br><span class="hljs-meta">@Component</span><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">Timer</span> &#123;<br>    <span class="hljs-meta">@Scheduled(cron = &quot;*/2 * * * * *&quot;)</span><br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">timer</span><span class="hljs-params">()</span> &#123;<br>        System.out.println(<span class="hljs-string">&quot;哈哈哈哈&quot;</span>);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="如果有多个定时任务类，可以考虑把-EnableScheduling-注解添加在启动类上"><a href="#如果有多个定时任务类，可以考虑把-EnableScheduling-注解添加在启动类上" class="headerlink" title="如果有多个定时任务类，可以考虑把@EnableScheduling 注解添加在启动类上"></a>如果有多个定时任务类，可以考虑把@EnableScheduling 注解添加在启动类上</h5></li>
</ul>
<h4 id="Cron-表达式"><a href="#Cron-表达式" class="headerlink" title="Cron 表达式"></a>Cron 表达式</h4><ul>
<li><h5 id="在线生成工具：在线-Cron-表达式生成器-qqe2-com"><a href="#在线生成工具：在线-Cron-表达式生成器-qqe2-com" class="headerlink" title="在线生成工具：在线 Cron 表达式生成器 (qqe2.com)"></a>在线生成工具：<a target="_blank" rel="noopener" href="https://cron.qqe2.com/">在线 Cron 表达式生成器 (qqe2.com)</a></h5></li>
<li><h5 id="简单地介绍下如何使用吧：（2023-08-25-早）"><a href="#简单地介绍下如何使用吧：（2023-08-25-早）" class="headerlink" title="简单地介绍下如何使用吧：（2023/08/25 早）"></a>简单地介绍下如何使用吧：（2023/08/25 早）</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230829122937976.png" alt="image-20230829122937976"></p>
<p><img src="http://blog.memory-life.xyz/image-20230829123041111.png" alt="image-20230829123041111"></p>
<p><img src="http://blog.memory-life.xyz/image-20230829123201856.png" alt="image-20230829123201856"></p>
<p><img src="http://blog.memory-life.xyz/image-20231022143837175.png" alt="image-20231022143837175"></p>
<h3 id="项目目录显示问题"><a href="#项目目录显示问题" class="headerlink" title="项目目录显示问题"></a>项目目录显示问题</h3><p>昨天重构项目之后，项目目录变成了这样，待解决：<strong>（2024/01/19 午）</strong></p>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20240119141255836.png" alt="image-20240119141255836"></p>
<p>解决了，取消这个显示就行了：</p>
<p><img src="http://blog.memory-life.xyz/image-20240119141720399.png" alt="image-20240119141720399"></p>
<h2 id="设置技巧"><a href="#设置技巧" class="headerlink" title="设置技巧"></a>设置技巧</h2><h3 id="注释对齐"><a href="#注释对齐" class="headerlink" title="注释对齐"></a>注释对齐</h3><ul>
<li><h5 id="按如下步骤进行设置："><a href="#按如下步骤进行设置：" class="headerlink" title="按如下步骤进行设置："></a>按如下步骤进行设置：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20231008090705284.png" alt="image-20231008090705284"></p>
<ul>
<li>当我们在这里打上注释：</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20231008090833683.png" alt="image-20231008090833683"></p>
<ul>
<li>按 <strong>Ctrl + / 快捷键</strong>，就是这样的效果：<strong>（2023/10/08 早）</strong></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20231008090915001.png" alt="image-20231008090915001"></p>
<h2 id="Java-基础"><a href="#Java-基础" class="headerlink" title="Java 基础"></a>Java 基础</h2><ul>
<li><h5 id="本人太菜，不定时巩固-Java-基础，今天巩固如下操作：（2023-08-14-早）"><a href="#本人太菜，不定时巩固-Java-基础，今天巩固如下操作：（2023-08-14-早）" class="headerlink" title="本人太菜，不定时巩固 Java 基础，今天巩固如下操作：（2023/08/14 早）"></a>本人太菜，不定时巩固 Java 基础，今天巩固如下操作：（2023/08/14 早）</h5><ul>
<li><p>Radom 随机数</p>
</li>
<li><p>Collections 排序</p>
</li>
<li><p>Stream 流遍历</p>
</li>
<li><p>System.currentTimeMillis() 计时</p>
</li>
</ul>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// Radom 随机数</span><br><span class="hljs-type">Random</span> <span class="hljs-variable">random</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Random</span>();<br>     ArrayList&lt;Double&gt; arrayList = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br>     <span class="hljs-type">long</span> <span class="hljs-variable">startTime</span> <span class="hljs-operator">=</span> System.currentTimeMillis();<br>     <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">100000</span>; i++) &#123;<br>         arrayList.add(random.nextDouble());<br>     &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// Collections 排序</span><br><span class="hljs-comment">// 第一种方法</span><br>      Collections.sort(arrayList, <span class="hljs-keyword">new</span> <span class="hljs-title class_">Comparator</span>&lt;Double&gt;() &#123;<br>          <span class="hljs-meta">@Override</span><br>          <span class="hljs-keyword">public</span> <span class="hljs-type">int</span> <span class="hljs-title function_">compare</span><span class="hljs-params">(Double o1, Double o2)</span> &#123;<br>              <span class="hljs-keyword">return</span> o1.compareTo(o2);<br>          &#125;<br>      &#125;);<br>      <span class="hljs-comment">// 第二种方法</span><br>      Collections.sort(arrayList, (o1, o2) -&gt; &#123;<br>          <span class="hljs-keyword">return</span> o1.compareTo(o2);<br>      &#125;);<br>      <span class="hljs-comment">// 第三种方法</span><br>      Collections.sort(arrayList, (o1, o2) -&gt; o1.compareTo(o2));<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// Stream 流便利</span><br>       <span class="hljs-comment">// 第一种方法</span><br>        arrayList.forEach(item -&gt; &#123;<br>            System.out.println(item);<br>        &#125;);<br><br>        <span class="hljs-comment">// 第二种方法</span><br>        arrayList.stream().forEach(item -&gt; System.out.println(item));<br>    &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs java">List&lt;Integer&gt; userList = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br><br>       <span class="hljs-type">Random</span> <span class="hljs-variable">rand</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">Random</span>();<br>       <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i &lt; <span class="hljs-number">10000</span>; i++) &#123;<br>           userList.add(rand.nextInt(<span class="hljs-number">1000</span>));<br>       &#125;<br><br>       List&lt;Integer&gt; userList2 = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br>       userList2.addAll(userList);<br><br>       <span class="hljs-type">Long</span> <span class="hljs-variable">startTime1</span> <span class="hljs-operator">=</span> System.currentTimeMillis();<br>       userList2.stream().sorted(Comparator.comparing(Integer::intValue)).collect(Collectors.toList());<br>       System.out.println(<span class="hljs-string">&quot;stream.sort耗时：&quot;</span> + (System.currentTimeMillis() - startTime1) + <span class="hljs-string">&quot;ms&quot;</span>);<br><br>       <span class="hljs-type">Long</span> <span class="hljs-variable">startTime</span> <span class="hljs-operator">=</span> System.currentTimeMillis();<br>       userList.sort(Comparator.comparing(Integer::intValue));<br>       System.out.println(<span class="hljs-string">&quot;List.sort()耗时：&quot;</span> + (System.currentTimeMillis() - startTime) + <span class="hljs-string">&quot;ms&quot;</span>);<br></code></pre></td></tr></table></figure>

<ul>
<li>有时间总结下 SpringBoot 中的定时任务：<a target="_blank" rel="noopener" href="https://juejin.cn/post/7158851405531316254">我终于会写 Java 的定时任务了！ - 掘金 (juejin.cn)</a></li>
</ul>
<h3 id="Date-Time-API"><a href="#Date-Time-API" class="headerlink" title="Date/Time API"></a>Date/Time API</h3><ul>
<li><h5 id="学习以下内容可以参考这篇博客：8-个你必须知道的-Java8-新特性，让你的代码变得优雅！-掘金-juejin-cn"><a href="#学习以下内容可以参考这篇博客：8-个你必须知道的-Java8-新特性，让你的代码变得优雅！-掘金-juejin-cn" class="headerlink" title="学习以下内容可以参考这篇博客：8 个你必须知道的 Java8 新特性，让你的代码变得优雅！ - 掘金 (juejin.cn)"></a>学习以下内容可以参考这篇博客：<a target="_blank" rel="noopener" href="https://juejin.cn/post/7240697872160833596">8 个你必须知道的 Java8 新特性，让你的代码变得优雅！ - 掘金 (juejin.cn)</a></h5></li>
<li><p>在 Java 8 中引入了全新的日期时间处理类库，使得处理日期时间变得更加方便和易于理解</p>
</li>
<li><h5 id="以下是-java-time-包中最重要的一些类：（2023-08-18-午）"><a href="#以下是-java-time-包中最重要的一些类：（2023-08-18-午）" class="headerlink" title="以下是 java.time 包中最重要的一些类：（2023/08/18 午）"></a>以下是 <code>java.time</code> 包中最重要的一些类：（2023/08/18 午）</h5><ul>
<li>LocalDate：表示日期，如 2022 年 5 月 15 日。</li>
<li><code>LocalTime</code>：表示时间，如 13:45:30。</li>
<li><code>LocalDateTime</code>：代表日期和时间，比如 2022 年 5 月 15 日 13:45:30。</li>
<li><code>ZonedDateTime</code>：代表带有时区的日期时间，在上述所有日期时间类型的基础上，还提供了时区信息。</li>
<li><code>Duration</code>：在两个时间点之间表示时间量。</li>
<li><code>Period</code>：在两个日期之间表示天、周、月或年的数量。</li>
<li><code>DateTimeFormatter</code>：可以将日期时间对象按照指定的格式进行格式化或者解析。</li>
</ul>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">test</span><span class="hljs-params">()</span> &#123;<br>    <span class="hljs-comment">// 获取日期</span><br>    <span class="hljs-type">LocalDateTime</span> <span class="hljs-variable">dateTime</span> <span class="hljs-operator">=</span> LocalDateTime.now();<br>    System.out.println(dateTime);<br>    <span class="hljs-comment">// 日期格式</span><br>    <span class="hljs-type">DateTimeFormatter</span> <span class="hljs-variable">pattern</span> <span class="hljs-operator">=</span> DateTimeFormatter.ofPattern(<span class="hljs-string">&quot;yyyy-MM-dd HH:mm:ss&quot;</span>);<br>    <span class="hljs-type">String</span> <span class="hljs-variable">format</span> <span class="hljs-operator">=</span> dateTime.format(pattern);<br>    System.out.println(format);<br><br>    <span class="hljs-type">String</span> <span class="hljs-variable">now</span> <span class="hljs-operator">=</span> LocalDateTime.now().format(DateTimeFormatter.ofPattern(<span class="hljs-string">&quot;yyyy年MM月dd日 HH时mm分ss秒&quot;</span>));<br>    System.out.println(now);<br>&#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">test2</span><span class="hljs-params">()</span> &#123;<br>     <span class="hljs-comment">// 获取日期</span><br>     <span class="hljs-type">Duration</span> <span class="hljs-variable">between</span> <span class="hljs-operator">=</span> Duration.between(LocalDate.of(<span class="hljs-number">2022</span>, Month.JULY, <span class="hljs-number">10</span>), LocalDate.now());<br>     System.out.println(between);<br>     <span class="hljs-type">Duration</span> <span class="hljs-variable">between1</span> <span class="hljs-operator">=</span> Duration.between(LocalTime.of(<span class="hljs-number">12</span>, <span class="hljs-number">29</span>, <span class="hljs-number">10</span>), LocalDate.now());<br>     System.out.println(between1);<br> &#125;<br></code></pre></td></tr></table></figure>

<h3 id="Optional-容器类型"><a href="#Optional-容器类型" class="headerlink" title="Optional 容器类型"></a>Optional 容器类型</h3><ul>
<li><h5 id="ofNullable-方法：创建一个可能包含-null-值的-Optional-对象（2023-08-18-午）"><a href="#ofNullable-方法：创建一个可能包含-null-值的-Optional-对象（2023-08-18-午）" class="headerlink" title="ofNullable() 方法：创建一个可能包含 null 值的 Optional 对象（2023/08/18 午）"></a>ofNullable() 方法：创建一个可能包含 null 值的 Optional 对象（2023/08/18 午）</h5></li>
<li><h5 id="isPresent-方法：判断-Optional-中是否存在值。返回-ture-表示存在值-返回-false-表示为-null"><a href="#isPresent-方法：判断-Optional-中是否存在值。返回-ture-表示存在值-返回-false-表示为-null" class="headerlink" title="isPresent() 方法：判断 Optional 中是否存在值。返回 ture 表示存在值 返回 false 表示为 null"></a>isPresent() 方法：判断 Optional 中是否存在值。返回 ture 表示存在值 返回 false 表示为 null</h5></li>
<li><h5 id="get-方法：如果-Optional-的值存在则返回该值，否则抛出-NoSuchElementException-异常。"><a href="#get-方法：如果-Optional-的值存在则返回该值，否则抛出-NoSuchElementException-异常。" class="headerlink" title="get() 方法：如果 Optional 的值存在则返回该值，否则抛出 NoSuchElementException 异常。"></a>get() 方法：如果 Optional 的值存在则返回该值，否则抛出 NoSuchElementException 异常。</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">test3</span><span class="hljs-params">()</span> &#123;<br>    <span class="hljs-comment">// 判断值是否为空</span><br>    Optional&lt;String&gt; optional = Optional.of(<span class="hljs-string">&quot;hhh&quot;</span>);<br>    <span class="hljs-keyword">if</span> (optional.isPresent()) &#123;<br>        System.out.println(optional.get());<br>    &#125;<br><br>    Optional.of(<span class="hljs-string">&quot;hhh&quot;</span>).ifPresent(System.out::println);<br>&#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">test4</span><span class="hljs-params">(User user)</span> &#123;<br>    Optional.ofNullable(user).map(User::getName).ifPresentOrElse(out::println, user != <span class="hljs-literal">null</span> ?      user.setName(<span class="hljs-string">&quot;ccc&quot;</span>) : <span class="hljs-literal">null</span>);<br>&#125;<br></code></pre></td></tr></table></figure>

<h3 id="BigDecimal"><a href="#BigDecimal" class="headerlink" title="BigDecimal"></a>BigDecimal</h3><ul>
<li><h5 id="使用-BigDecimal-需要注意的-6-点：（2023-08-19-早）"><a href="#使用-BigDecimal-需要注意的-6-点：（2023-08-19-早）" class="headerlink" title="使用 BigDecimal 需要注意的 6 点：（2023/08/19 早）"></a>使用 BigDecimal 需要注意的 6 点：（2023/08/19 早）</h5><ul>
<li>构造初始化</li>
<li>加减乘除</li>
<li>设置精度</li>
<li>去掉末尾的 0</li>
<li>转换为 Double</li>
<li>比较大小</li>
</ul>
</li>
<li><p><a target="_blank" rel="noopener" href="https://juejin.cn/post/7207617774633320504#comment">BigDecimal 不可触碰的 6 个坑 - 掘金 (juejin.cn)</a></p>
</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">test5</span><span class="hljs-params">()</span> &#123;<br>      <span class="hljs-comment">// 1.两个BigDecimal对象</span><br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">dec1</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BigDecimal</span>(<span class="hljs-string">&quot;1.3&quot;</span>);<br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">dec2</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BigDecimal</span>(<span class="hljs-string">&quot;1.3&quot;</span>);<br><br>      <span class="hljs-comment">// 2.加减乘除</span><br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">add</span> <span class="hljs-operator">=</span> dec1.add(dec2);<br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">subtract</span> <span class="hljs-operator">=</span> dec1.subtract(dec2);<br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">multiply</span> <span class="hljs-operator">=</span> dec1.multiply(dec2);<br><br>      <span class="hljs-comment">// 3.设置精度</span><br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">divide</span> <span class="hljs-operator">=</span> dec1.divide(dec2).setScale(<span class="hljs-number">3</span>, RoundingMode.HALF_DOWN);<br><br>      out.println(add);<br>      out.println(subtract);<br>      out.println(multiply);<br>      System.out.println(divide);<br><br>      <span class="hljs-comment">// 4.去掉末尾的0</span><br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">bigDecimal</span> <span class="hljs-operator">=</span> divide.stripTrailingZeros();<br>      out.println(bigDecimal);<br><br>      <span class="hljs-comment">// 5.转换为Double</span><br>      <span class="hljs-type">BigDecimal</span> <span class="hljs-variable">value</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">BigDecimal</span>(<span class="hljs-string">&quot;1888977466432.1241341341413414&quot;</span>);<br>      <span class="hljs-type">double</span> <span class="hljs-variable">doubleValue</span> <span class="hljs-operator">=</span> value.doubleValue();<br>      out.println(doubleValue);<br>      <span class="hljs-type">double</span> <span class="hljs-variable">doubleValue1</span> <span class="hljs-operator">=</span> value.toBigInteger().doubleValue();<br>      out.println(doubleValue1);<br><br>      <span class="hljs-comment">// 6.比较大小</span><br>      out.println(add.compareTo(subtract) &gt; <span class="hljs-number">0</span> ? <span class="hljs-string">&quot;add大于sub&quot;</span> : <span class="hljs-string">&quot;add小于sub&quot;</span>);<br>  &#125;<br></code></pre></td></tr></table></figure>

<h3 id="数组转字符串"><a href="#数组转字符串" class="headerlink" title="数组转字符串"></a>数组转字符串</h3><ul>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/haohaiyou/p/16806399.html">JAVA 数组转字符串 - 一只忙碌的蜗牛 - 博客园 (cnblogs.com)</a></li>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_35939148/article/details/131495097">Java 中数组转字符串的五种方式效率比较_java 数组转字符串_likaistart 的博客-CSDN 博客</a></li>
<li><h5 id="数组如何转字符串？我们有好多种方案"><a href="#数组如何转字符串？我们有好多种方案" class="headerlink" title="数组如何转字符串？我们有好多种方案"></a>数组如何转字符串？我们有好多种方案</h5></li>
<li><h5 id="我们经常能遇到这样的情景："><a href="#我们经常能遇到这样的情景：" class="headerlink" title="我们经常能遇到这样的情景："></a>我们经常能遇到这样的情景：</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// 创建一个List</span><br>List&lt;String&gt; list = Arrays.asList(<span class="hljs-string">&quot;Apple&quot;</span>, <span class="hljs-string">&quot;Banana&quot;</span>, <span class="hljs-string">&quot;Cherry&quot;</span>, <span class="hljs-string">&quot;Date&quot;</span>, <span class="hljs-string">&quot;Elderberry&quot;</span>);<br><span class="hljs-comment">// 创建一个String数组</span><br>String[] arr = &#123;<span class="hljs-string">&quot;0&quot;</span>, <span class="hljs-string">&quot;1&quot;</span>, <span class="hljs-string">&quot;2&quot;</span>, <span class="hljs-string">&quot;3&quot;</span>, <span class="hljs-string">&quot;4&quot;</span>, <span class="hljs-string">&quot;5&quot;</span>&#125;;<br></code></pre></td></tr></table></figure>

<ul>
<li><h5 id="如果是-List，则有如下转字符串的方法：（2023-09-20-晚）"><a href="#如果是-List，则有如下转字符串的方法：（2023-09-20-晚）" class="headerlink" title="如果是 List，则有如下转字符串的方法：（2023/09/20 晚）"></a>如果是 List，则有如下转字符串的方法：（2023/09/20 晚）</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// stream流</span><br><span class="hljs-type">String</span> <span class="hljs-variable">collect</span> <span class="hljs-operator">=</span> list.stream().collect(Collectors.joining(<span class="hljs-string">&quot;,&quot;</span>));<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">//org.apache.commons.lang3包</span><br><span class="hljs-type">String</span> <span class="hljs-variable">join</span> <span class="hljs-operator">=</span>  StringUtils.join(longList, <span class="hljs-string">&quot;,&quot;</span>);<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// StringBuilder</span><br><span class="hljs-type">StringBuilder</span> <span class="hljs-variable">sb</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">StringBuilder</span>();<br>        <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i &lt; list.size(); i++) &#123;<br>            sb.append(i);<br>            <span class="hljs-keyword">if</span> (i &lt; list.size() - <span class="hljs-number">1</span>) &#123;<br>                sb.append(<span class="hljs-string">&quot;,&quot;</span>);<br>         &#125;<br>   &#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// String.join</span><br><span class="hljs-type">String</span> <span class="hljs-variable">join</span> <span class="hljs-operator">=</span> String.join(<span class="hljs-string">&quot;,&quot;</span>, list);<br></code></pre></td></tr></table></figure>

<ul>
<li><p>以上方法，转换所消耗的<strong>时间越来越少</strong>，<strong>效率越来越高</strong></p>
</li>
<li><h5 id="如果是-String-，则有如下转字符串的方法：（2023-09-20-晚）"><a href="#如果是-String-，则有如下转字符串的方法：（2023-09-20-晚）" class="headerlink" title="如果是 String[]，则有如下转字符串的方法：（2023/09/20 晚）"></a>如果是 String[]，则有如下转字符串的方法：（2023/09/20 晚）</h5></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">//org.apache.commons.lang3包</span><br><span class="hljs-type">String</span> <span class="hljs-variable">join</span> <span class="hljs-operator">=</span>  StringUtils.join(longList, <span class="hljs-string">&quot;,&quot;</span>);<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">// String.join</span><br><span class="hljs-type">String</span> <span class="hljs-variable">join</span> <span class="hljs-operator">=</span> String.join(<span class="hljs-string">&quot;,&quot;</span>, list);<br></code></pre></td></tr></table></figure>

<h3 id="Java8-中的-Map-函数"><a href="#Java8-中的-Map-函数" class="headerlink" title="Java8 中的 Map 函数"></a>Java8 中的 Map 函数</h3><h4 id="computeIfAbsent"><a href="#computeIfAbsent" class="headerlink" title="computeIfAbsent"></a>computeIfAbsent</h4><ul>
<li>如果指定的 key 不存在于 Map 中，那么会执行指定的函数来计算并将结果作为 value 放入到 Map 中。</li>
<li>如果指定的 key 已经存在于 Map 中，则不会执行计算函数，而是直接返回已存在的 value。</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> java.util.HashMap;<br><span class="hljs-keyword">import</span> java.util.Map;<br><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">ComputeIfAbsentExample</span> &#123;<br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">main</span><span class="hljs-params">(String[] args)</span> &#123;<br>        Map&lt;String, Integer&gt; map = <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;&gt;();<br>        map.put(<span class="hljs-string">&quot;apple&quot;</span>, <span class="hljs-number">1</span>);<br>        map.put(<span class="hljs-string">&quot;banana&quot;</span>, <span class="hljs-number">2</span>);<br><br>        <span class="hljs-comment">// 当key不存在时，执行计算函数并将结果放入Map</span><br>        map.computeIfAbsent(<span class="hljs-string">&quot;orange&quot;</span>, key -&gt; &#123;<br>            System.out.println(<span class="hljs-string">&quot;Performing computation for orange&quot;</span>);<br>            <span class="hljs-keyword">return</span> key.length();<br>        &#125;);<br><br>        <span class="hljs-comment">// 当key已存在时，不执行计算函数，直接返回已存在的value</span><br>        map.computeIfAbsent(<span class="hljs-string">&quot;apple&quot;</span>, key -&gt; &#123;<br>            System.out.println(<span class="hljs-string">&quot;Performing computation for apple&quot;</span>);<br>            <span class="hljs-keyword">return</span> key.length();<br>        &#125;);<br><br>        System.out.println(map);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<h4 id="computeIfPresent"><a href="#computeIfPresent" class="headerlink" title="computeIfPresent"></a>computeIfPresent</h4><ul>
<li>如果指定的 key 存在于 Map 中，那么会执行指定的函数来计算并将结果作为新的 value 放入到 Map 中。</li>
<li>如果指定的 key 不存在于 Map 中，则不会执行计算函数，什么也不做</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> java.util.HashMap;<br><span class="hljs-keyword">import</span> java.util.Map;<br><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">ComputeIfPresentExample</span> &#123;<br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">main</span><span class="hljs-params">(String[] args)</span> &#123;<br>        Map&lt;String, Integer&gt; map = <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;&gt;();<br>        map.put(<span class="hljs-string">&quot;apple&quot;</span>, <span class="hljs-number">1</span>);<br>        map.put(<span class="hljs-string">&quot;banana&quot;</span>, <span class="hljs-number">2</span>);<br><br>        map.computeIfPresent(<span class="hljs-string">&quot;apple&quot;</span>, (key, value) -&gt; value * <span class="hljs-number">2</span>);<br>        map.computeIfPresent(<span class="hljs-string">&quot;orange&quot;</span>, (key, value) -&gt; value * <span class="hljs-number">2</span>);<br><br>        System.out.println(map);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<h4 id="compute"><a href="#compute" class="headerlink" title="compute"></a>compute</h4><ul>
<li>而<code>compute()</code>函数无论旧的 value 是否为<code>null</code>，都会调用计算函数来计算新的 value，并将计算结果更新到 Map 中。</li>
<li>如果计算结果为<code>null</code>，则会将对应的 key 从 Map 中移除。</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">import</span> java.util.HashMap;<br><span class="hljs-keyword">import</span> java.util.Map;<br><br><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">ComputeExample</span> &#123;<br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">main</span><span class="hljs-params">(String[] args)</span> &#123;<br>        Map&lt;String, Integer&gt; map = <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;&gt;();<br>        map.put(<span class="hljs-string">&quot;apple&quot;</span>, <span class="hljs-number">1</span>);<br>        map.put(<span class="hljs-string">&quot;banana&quot;</span>, <span class="hljs-literal">null</span>);<br><br>        <span class="hljs-comment">// 使用computeIfPresent()</span><br>        map.computeIfPresent(<span class="hljs-string">&quot;apple&quot;</span>, (key, value) -&gt; value * <span class="hljs-number">2</span>);<br>        map.computeIfPresent(<span class="hljs-string">&quot;banana&quot;</span>, (key, value) -&gt; value * <span class="hljs-number">2</span>);<br>        System.out.println(map); <span class="hljs-comment">// 输出: &#123;apple=2&#125;</span><br><br>        <span class="hljs-comment">// 使用compute()</span><br>        map.compute(<span class="hljs-string">&quot;apple&quot;</span>, (key, value) -&gt; value + <span class="hljs-number">3</span>);<br>        map.compute(<span class="hljs-string">&quot;banana&quot;</span>, (key, value) -&gt; value + <span class="hljs-number">3</span>);<br>        System.out.println(map); <span class="hljs-comment">// 输出: &#123;apple=5, banana=null&#125;</span><br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<h4 id="merge"><a href="#merge" class="headerlink" title="merge"></a>merge</h4><ul>
<li>这个目前还不太明白，按下不表：</li>
</ul>
<figure class="highlight livescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs livescript"><span class="hljs-keyword">import</span> java.util.HashMap;<br><span class="hljs-keyword">import</span> java.util.<span class="hljs-built_in">Map</span>;<br><br>public <span class="hljs-keyword">class</span> <span class="hljs-title class_">MergeExample</span> &#123;<br>    public <span class="hljs-keyword">static</span> <span class="hljs-literal">void</span> main(<span class="hljs-built_in">String</span>[] args) &#123;<br>        <span class="hljs-built_in">Map</span>&lt;<span class="hljs-built_in">String</span>, Integer&gt; map1 = <span class="hljs-keyword">new</span> HashMap&lt;&gt;();<br>        map1.put(<span class="hljs-string">&quot;apple&quot;</span>, <span class="hljs-number">1</span>);<br>        map1.put(<span class="hljs-string">&quot;banana&quot;</span>, <span class="hljs-number">2</span>);<br><br>        <span class="hljs-built_in">Map</span>&lt;<span class="hljs-built_in">String</span>, Integer&gt; map2 = <span class="hljs-keyword">new</span> HashMap&lt;&gt;();<br>        map2.put(<span class="hljs-string">&quot;apple&quot;</span>, <span class="hljs-number">5</span>);<br>        map2.put(<span class="hljs-string">&quot;orange&quot;</span>, <span class="hljs-number">3</span>);<br><br>        map2.forEach<span class="hljs-function"><span class="hljs-params">((key, value) -&gt; &#123;</span></span><br><span class="hljs-params"><span class="hljs-function">            map1.merge(key, value, (oldValue, newValue) -&gt; oldValue + newValue);</span></span><br><span class="hljs-params"><span class="hljs-function">        &#125;)</span>;</span><br><span class="hljs-function"></span><br><span class="hljs-function">        <span class="hljs-title">System</span>.<span class="hljs-title">out</span>.<span class="hljs-title">println</span><span class="hljs-params">(map1)</span>; // 输出: &#123;<span class="hljs-title">orange</span>=3, <span class="hljs-title">apple</span>=6, <span class="hljs-title">banana</span>=2&#125;</span><br><span class="hljs-function">    &#125;</span><br><span class="hljs-function">&#125;</span><br></code></pre></td></tr></table></figure>

<h4 id="getOrDefalut"><a href="#getOrDefalut" class="headerlink" title="getOrDefalut"></a>getOrDefalut</h4><ul>
<li>当 key 存在时，取对应 value，否则取默认值</li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-type">int</span> <span class="hljs-title function_">firstUniqChar</span><span class="hljs-params">(String s)</span> &#123;<br>       <span class="hljs-keyword">if</span> (s == <span class="hljs-literal">null</span> || s.length() == <span class="hljs-number">0</span>) &#123;<br>           <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>       &#125;<br>       Map&lt;Character, Integer&gt; frequency = <span class="hljs-keyword">new</span> <span class="hljs-title class_">HashMap</span>&lt;Character, Integer&gt;();<br>       <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i &lt; s.length(); ++i) &#123;<br>           <span class="hljs-type">char</span> <span class="hljs-variable">ch</span> <span class="hljs-operator">=</span> s.charAt(i);<br>           frequency.put(ch, frequency.getOrDefault(ch, <span class="hljs-number">0</span>) + <span class="hljs-number">1</span>);<br>       &#125;<br>       <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> <span class="hljs-variable">i</span> <span class="hljs-operator">=</span> <span class="hljs-number">0</span>; i &lt; s.length(); ++i) &#123;<br>           <span class="hljs-keyword">if</span> (frequency.get(s.charAt(i)) == <span class="hljs-number">1</span>) &#123;<br>               <span class="hljs-keyword">return</span> i;<br>           &#125;<br>       &#125;<br>       <span class="hljs-keyword">return</span> -<span class="hljs-number">1</span>;<br>   &#125;<br></code></pre></td></tr></table></figure>

<h4 id="putIfAbsent"><a href="#putIfAbsent" class="headerlink" title="putIfAbsent"></a>putIfAbsent</h4><ul>
<li>与 put 的区别：如果有重复 key，保存的是<strong>最早存入的键值对</strong> <strong>（2023/10/08 早）</strong></li>
</ul>
<h4 id="forEach"><a href="#forEach" class="headerlink" title="forEach"></a>forEach</h4><h3 id="Java8-中的-Stream-流函数"><a href="#Java8-中的-Stream-流函数" class="headerlink" title="Java8 中的 Stream 流函数"></a>Java8 中的 Stream 流函数</h3><h4 id="groupingBy"><a href="#groupingBy" class="headerlink" title="groupingBy"></a>groupingBy</h4><ul>
<li>将集合中的元素，<strong>按某个属性进行分组</strong>，<strong>返回的结果</strong>是一个 <strong>Map 集合</strong> <strong>（2023/10/08 早）</strong></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">Person</span> &#123;<br>    <span class="hljs-keyword">private</span> <span class="hljs-type">int</span> age;<br>    <span class="hljs-keyword">private</span> String name;<br><br>    <span class="hljs-keyword">public</span> <span class="hljs-title function_">Person</span><span class="hljs-params">(<span class="hljs-type">int</span> age, String name)</span> &#123;<br>        <span class="hljs-built_in">this</span>.age = age;<br>        <span class="hljs-built_in">this</span>.name = name;<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title class_">GroupingByExample</span> &#123;<br>    <span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title function_">main</span><span class="hljs-params">(String[] args)</span> &#123;<br>        List&lt;Person&gt; people = <span class="hljs-keyword">new</span> <span class="hljs-title class_">ArrayList</span>&lt;&gt;();<br>        people.add(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Person</span>(<span class="hljs-number">25</span>, <span class="hljs-string">&quot;Alice&quot;</span>));<br>        people.add(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Person</span>(<span class="hljs-number">30</span>, <span class="hljs-string">&quot;Bob&quot;</span>));<br>        people.add(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Person</span>(<span class="hljs-number">25</span>, <span class="hljs-string">&quot;Charlie&quot;</span>));<br>        people.add(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Person</span>(<span class="hljs-number">40</span>, <span class="hljs-string">&quot;David&quot;</span>));<br>        people.add(<span class="hljs-keyword">new</span> <span class="hljs-title class_">Person</span>(<span class="hljs-number">30</span>, <span class="hljs-string">&quot;Emily&quot;</span>));<br><br>        Map&lt;Integer, List&lt;Person&gt;&gt; groups = people.stream()<br>                .collect(Collectors.groupingBy(Person::getAge));<br><br>        System.out.println(groups);<br>    &#125;<br>&#125;<br></code></pre></td></tr></table></figure>

<h3 id="泛型理解"><a href="#泛型理解" class="headerlink" title="泛型理解"></a>泛型理解</h3><ul>
<li><h5 id="推荐学习：我真的了解泛型吗？-掘金-juejin-cn"><a href="#推荐学习：我真的了解泛型吗？-掘金-juejin-cn" class="headerlink" title="推荐学习：我真的了解泛型吗？ - 掘金 (juejin.cn)"></a>推荐学习：<a target="_blank" rel="noopener" href="https://juejin.cn/post/7263810695459504189#heading-8">我真的了解泛型吗？ - 掘金 (juejin.cn)</a></h5></li>
<li><h5 id="学习-Java-泛型：（2023-10-13-晚）"><a href="#学习-Java-泛型：（2023-10-13-晚）" class="headerlink" title="学习 Java 泛型：（2023/10/13 晚）"></a>学习 Java 泛型：（2023/10/13 晚）</h5><ul>
<li>泛型类</li>
<li>泛型接口</li>
<li>泛型方法：返回值、入参位置、方法体中</li>
<li>个人感受：泛型很好理解：我们经常讲到一个对象实例的就是以类作为模板创建的，那么也可以讲一个普通类可以以泛型类作为模板；那么泛型是用来干嘛的呢，我们为什么要使用泛型呢？其实，所有的泛型类在编译后生成的字节码与普通类无异，因为在编译前，所有泛型类型就被擦除了。所以我们可以把泛型看作一个语法糖，将类型转换的校验提前在编译时，减少类型转换错误的发生，使编写的程序更加具有健壮性。</li>
</ul>
</li>
<li><h5 id="我觉得以下这段总结更妙："><a href="#我觉得以下这段总结更妙：" class="headerlink" title="我觉得以下这段总结更妙："></a>我觉得以下这段总结更妙：</h5></li>
</ul>
<blockquote>
<p>泛型是 Java 语言中的一项强大的特性，它允许在编译时指定类、接口或方法的参数类型，从而在编译阶段就能够进行类型检查。这样可以减少类型转换的错误，并提高代码的安全性和可读性。</p>
<p>通过使用泛型，我们可以在编译时捕捉到一些类型错误，而不是在运行时才发现，这样可以避免一些潜在的 bug。泛型还可以增加代码的可重用性和灵活性，因为泛型类、接口和方法可以用于多种不同的类型，而无需针对每一种类型单独编写或重复编写相似的代码。</p>
<p>总的来说，通过使用泛型，我们可以在编写 Java 代码时更好地约束和使用类型信息，减少类型错误，提高代码的可读性和健壮性。</p>
</blockquote>
<ul>
<li><h5 id="了解泛型的实现原理，理解泛型的使用方式，更加加深了我们对-Java-语言的理解"><a href="#了解泛型的实现原理，理解泛型的使用方式，更加加深了我们对-Java-语言的理解" class="headerlink" title="了解泛型的实现原理，理解泛型的使用方式，更加加深了我们对 Java 语言的理解"></a>了解泛型的实现原理，理解泛型的使用方式，更加加深了我们对 Java 语言的理解</h5></li>
</ul>
<h2 id="良心插件"><a href="#良心插件" class="headerlink" title="良心插件"></a>良心插件</h2><h3 id="carbon-now-sh"><a href="#carbon-now-sh" class="headerlink" title="carbon-now-sh"></a>carbon-now-sh</h3><ul>
<li><h5 id="carbon-now-sh：代码贴图工具（2023-08-20-晚）"><a href="#carbon-now-sh：代码贴图工具（2023-08-20-晚）" class="headerlink" title="carbon-now-sh：代码贴图工具（2023/08/20 晚）"></a>carbon-now-sh：代码贴图工具（2023/08/20 晚）</h5></li>
<li><p>选择一段代码，右键菜单点击 Open in carbon.now.sh：</p>
</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230820220508484.png" alt="image-20230820220508484"></p>
<ul>
<li><h5 id="在弹出的网页页面中，可以调整代码风格，点击导出就下载成功了"><a href="#在弹出的网页页面中，可以调整代码风格，点击导出就下载成功了" class="headerlink" title="在弹出的网页页面中，可以调整代码风格，点击导出就下载成功了~"></a>在弹出的网页页面中，可以调整代码风格，点击导出就下载成功了~</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230820220640005.png" alt="image-20230820220640005"></p>
<blockquote>
<p>2025 年 1 月 8 日</p>
</blockquote>
<p>简单调整一下代码样式，可直接复制图片，节省出导出这一步的时间。</p>
<p><img src="http://blog.memory-life.xyz/image-20250108092049161.png" alt="image-20250108092049161"></p>
<p><img src="http://blog.memory-life.xyz/image-20250108091917047.png" alt="image-20250108091917047"></p>
<p><img src="http://blog.memory-life.xyz/image-20250108092123958.png" alt="image-20250108092123958"></p>
<p><img src="http://blog.memory-life.xyz/image-20250108092210986.png" alt="image-20250108092210986"></p>
<h3 id="MybatisX-Genetator"><a href="#MybatisX-Genetator" class="headerlink" title="MybatisX-Genetator"></a>MybatisX-Genetator</h3><ul>
<li><h5 id="MybatisX-Genetator：代码自动生成器"><a href="#MybatisX-Genetator：代码自动生成器" class="headerlink" title="MybatisX-Genetator：代码自动生成器"></a>MybatisX-Genetator：代码自动生成器</h5></li>
<li><h5 id="连接到数据库后，在一个表右键菜单点击-MybatisX-Genetator：（2023-08-20-晚）"><a href="#连接到数据库后，在一个表右键菜单点击-MybatisX-Genetator：（2023-08-20-晚）" class="headerlink" title="连接到数据库后，在一个表右键菜单点击 MybatisX-Genetator：（2023/08/20 晚）"></a>连接到数据库后，在一个表右键菜单点击 MybatisX-Genetator：（2023/08/20 晚）</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230820220815784.png" alt="image-20230820220815784"></p>
<ul>
<li>选择代码生成位置、编码格式、包名等信息：</li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230820221142630.png" alt="image-20230820221142630"></p>
<p><img src="http://blog.memory-life.xyz/image-20230820221240754.png" alt="image-20230820221240754"></p>
<ul>
<li><h5 id="点击-Finish，直接生成-domain、service、serviceImpl、mapper、mapperXml："><a href="#点击-Finish，直接生成-domain、service、serviceImpl、mapper、mapperXml：" class="headerlink" title="点击 Finish，直接生成 domain、service、serviceImpl、mapper、mapperXml："></a>点击 Finish，直接生成 domain、service、serviceImpl、mapper、mapperXml：</h5></li>
</ul>
<p><img src="http://blog.memory-life.xyz/image-20230820221655077.png" alt="image-20230820221655077"></p>
<h3 id="GenerateAllSetter"><a href="#GenerateAllSetter" class="headerlink" title="GenerateAllSetter"></a>GenerateAllSetter</h3><ul>
<li>这是一款<strong>快速生成对象的 getter、setter 方法</strong>的插件，对日常的代码开发很有帮助 <strong>（2023/10/05 晚）</strong></li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20231005195426227.png" alt="image-20231005195426227"></p>
<ul>
<li>我们定义一个 <strong>User 对象</strong>，右键，即可<strong>快速生成该对象的 geeter、setter 方法</strong>：</li>
</ul>
<p><img src="C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\image-20231005195434856.png" alt="image-20231005195434856"></p>
<ul>
<li>我在开发项目的过程中，<strong>转换 entity 为 对应 VO 对象</strong>时，使用该插件居多：<strong>（2023/10/05 晚）</strong></li>
</ul>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><code class="hljs java"><span class="hljs-comment">/**</span><br><span class="hljs-comment"> * 转换 teamList为 teamVOList</span><br><span class="hljs-comment"> *</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@param</span> teamList teamList</span><br><span class="hljs-comment"> * <span class="hljs-doctag">@return</span> teamVOList</span><br><span class="hljs-comment"> */</span><br><span class="hljs-keyword">public</span> List&lt;TeamVO&gt; <span class="hljs-title function_">getTeamVOByTeam</span><span class="hljs-params">(List&lt;Team&gt; teamList)</span> &#123;<br>    <span class="hljs-keyword">return</span> teamList.stream().map(team -&gt; &#123;<br>        <span class="hljs-type">Long</span> <span class="hljs-variable">userId</span> <span class="hljs-operator">=</span> team.getUserId();<br>        <span class="hljs-type">String</span> <span class="hljs-variable">userName</span> <span class="hljs-operator">=</span> userService.getById(userId).getUsername();<br>        <span class="hljs-type">TeamVO</span> <span class="hljs-variable">teamVO</span> <span class="hljs-operator">=</span> <span class="hljs-keyword">new</span> <span class="hljs-title class_">TeamVO</span>();<br><br>        teamVO.setId(team.getId());<br>        teamVO.setName(team.getName());<br>        teamVO.setDescription(team.getDescription());<br>        teamVO.setMaxNum(team.getMaxNum());<br>        teamVO.setUserName(userName);<br>        teamVO.setImgUrl(team.getImgUrl());<br>        teamVO.setJoinNum(team.getJoinNum());<br>        teamVO.setStatus(team.getStatus());<br>        teamVO.setExpireTime(team.getExpireTime());<br>        teamVO.setCreateTime(team.getCreateTime());<br>        teamVO.setUpdateTime(team.getUpdateTime());<br>        teamVO.setIsDelete(team.getIsDelete());<br>        teamVO.setAnnouncement(team.getAnnouncement());<br><br>        <span class="hljs-keyword">return</span> teamVO;<br>    &#125;).collect(Collectors.toList());<br>&#125;<br></code></pre></td></tr></table></figure>

<h3 id="String-Manipulation"><a href="#String-Manipulation" class="headerlink" title="String Manipulation"></a>String Manipulation</h3><p><img src="http://blog.memory-life.xyz/image-20240128171150346.png" alt="image-20240128171150346"></p>
<p>可以实现快速将选定字符串转换为大写：</p>
<p><img src="http://blog.memory-life.xyz/image-20240128171314634.png" alt="image-20240128171314634"></p>
<h3 id="Statistic"><a href="#Statistic" class="headerlink" title="Statistic"></a>Statistic</h3><blockquote>
<p>2025 年 1 月 8 日</p>
</blockquote>
<p><img src="http://blog.memory-life.xyz/image-20250108092946684.png" alt="image-20250108092946684"></p>
<p><img src="http://blog.memory-life.xyz/image-20250108092852104.png" alt="image-20250108092852104"></p>
<h3 id="通义灵码"><a href="#通义灵码" class="headerlink" title="通义灵码"></a>通义灵码</h3><blockquote>
<p>2025 年 7 月 21 日</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://blog.csdn.net/itwangyang520/article/details/146527206">IDEA 的 AI 编程插件推荐清单，大大提升你的开发效率！_idea ai插件-CSDN博客</a></p>
<h1 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h1>
                
              </div>
            
            <hr/>
            <div>
              <!-- 文章页面 - 底部标签 -->
<div class="post-metas my-3">
  
  <div class="post-meta mr-3 d-flex align-items-center">
    <i class="iconfont icon-category"></i>
    <!-- 归档页 - 文章列表 -->


<span class="category-chains">
  
  
    
      <span class="category-chain">
        
  <a href="/blog/categories/%E4%BB%A3%E7%A0%81%E9%94%8B%E8%8A%92/" class="category-chain-item">代码锋芒</a>
  
  

      </span>
    
  
</span>

  </div>
   
  <div class="post-meta">
    <i class="iconfont icon-tags"></i>
    
    <a href="/blog/tags/%E7%BB%8F%E9%AA%8C/">#经验</a>
    
    <a href="/blog/tags/IDEA/">#IDEA</a>
    
  </div>
  
</div>


              <!-- 文章页面 - 底部标签下方 -->

  
  <div class="license-box my-3">
    <div class="license-title">
      <div>打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化</div>
      <div>https://test.atomgit.net/blog/2023/07/06/打造流畅编码之旅：IntelliJ IDEA 的高效使用技巧与工作流程优化/</div>
    </div>
    <div class="license-meta">
      
        <div class="license-meta-item">
          <div>作者</div>
          <div>Memory</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>发布于</div>
          <div>2023年7月6日</div>
        </div>
      
      
        <div class="license-meta-item license-meta-date">
          <div>更新于</div>
          <div>2025年7月23日</div>
        </div>
      
      
        <div class="license-meta-item">
          <div>许可协议</div>
          <div>
            
              
              
                <a target="_blank" href="https://creativecommons.org/licenses/by/4.0/">
                  <span class="hint--top hint--rounded" aria-label="BY - 署名">
                    <i class="iconfont icon-by"></i>
                  </span>
                </a>
              
            
          </div>
        </div>
      
    </div>
    <div class="license-icon iconfont"></div>
  </div>



              
                <div class="post-prevnext my-3">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/blog/2023/07/06/%E5%87%A4%E5%87%B0%E6%B6%85%E6%A7%83%EF%BC%9ASpring%20Boot%20%E5%BC%80%E5%8F%91%E4%B9%8B%E8%B7%AF%E4%B8%8A%E7%9A%84%E5%9D%8E%E5%9D%B7%E4%B8%8E%E6%88%90%E9%95%BF/" title="凤凰涅槃：Spring Boot 开发之路上的坎坷与成长">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">凤凰涅槃：Spring Boot 开发之路上的坎坷与成长</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/blog/2023/07/02/%E7%90%86%E8%A7%A3npm%E3%80%81pnpm%E5%92%8Cyarn%EF%BC%9A%E9%80%89%E5%87%BA%E6%9C%80%E9%80%82%E5%90%88%E4%BD%A0%E7%9A%84%E5%8C%85%E7%AE%A1%E7%90%86%E5%99%A8/" title="理解npm、pnpm和yarn：选出最适合你的包管理器">
                        <span class="hidden-mobile">理解npm、pnpm和yarn：选出最适合你的包管理器</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            <!-- 文章页 - 评论上方 -->

  
  
    <article id="comments">
      
  <div id="valine"></div>
  <script type="text/javascript">
    Fluid.utils.loadComments('#valine', function() {
      Fluid.utils.createScript('https://cdn.jsdelivr.net/gh/HCLonely/Valine@latest/dist/Valine.min.js', function() {
        var options = Object.assign(
          {"appId":"T1hUHH9Ks1ggG9DBE3HgUPpV-gzGzoHsz","appKey":"XFkgzzvzNo3J3uNCbBiSOFKc","path":"window.location.pathname","placeholder":"填取QQ号和邮箱后评论，支持读取头像及消息提醒，留下点什么叭... ᶘ ᵒᴥᵒᶅ","avatar":"Gravatar","meta":["nick","mail","link"],"requiredFields":[],"pageSize":10,"lang":"zh-CN","highlight":true,"recordIP":false,"serverURLs":"https://t1huhh9k.lc-cn-n1-shared.com","emojiCDN":null,"emojiMaps":null,"enableQQ":true,"master":"8c9b6d6637904da62d74d019cc6982de","friends":"0188229a9cfc284176ea9135cb9514cc","visitor":true},
          {
            el: "#valine",
            path: window.location.pathname,
            app_id: "",
            app_key: "",
            placeholder: "填取QQ号和邮箱后评论，支持读取头像及消息提醒，留下点什么叭... ᶘ ᵒᴥᵒᶅ",
            avatar: "Gravatar",
            meta: ["nick","mail","link"],
            pageSize: "10",
            lang: "zh-CN",
            highlight: true,
            recordIP: false,
            serverURLs: "https://t1huhh9k.lc-cn-n1-shared.com",

            // 设置Bilibili表情包地址
            emojiCDN: '//i0.hdslb.com/bfs/emote/', 
            // 表情title和图片映射
            emojiMaps: {
                "tv_白眼": "48f75163437445665a9be80bb316e4cb252c5415.gif@48w_48h.webp",
                "tv_doge": "302d6c88c63ed162c81a49cafe7ed2709e6fb955.gif@48w_48h.webp",
                "tv_坏笑": "5d2572efd09aab5dde9e2a198bb3f9ac1e2a982e.gif@48w_48h.webp",
                "tv_难过": "9c6b41008a67755410f712334c64313df5f91b3f.gif@48w_48h.webp",
                "tv_生气": "1902a5a2df5b5c931d88c12f0feb264b1e109d0d.gif@48w_48h.webp",
                "tv_委屈": "af5a5853edb43a8178a8cb5df707fa5e88143699.gif@48w_48h.webp",
                "tv_斜眼笑": "c66568b471192ca1f62f6ed4384dc1b283ab7508.gif@48w_48h.webp",
                "tv_呆": "d3fa91e4db9215eb1e20ab9da44f1214aa4bda7b.gif@48w_48h.webp",
                "tv_发怒": "3959eb81b952e4fa8d269d98f9e3639172d84073.gif@48w_48h.webp",
                "tv_呕吐": "db58e9442aae26694af18cc1683607cca3a16763.gif@48w_48h.webp",
                "tv_思考": "b63f9146bfd985af014f8d6d4bdb498805be48f9.gif@48w_48h.webp",
                "tv_微笑": "b98656855d782f61cb8edc7f7fca6563ecafff7e.gif@48w_48h.webp",
                "tv_疑问": "fce1b1a0f3b0e39a2dc16a18508dba7b91e929f4.gif@48w_48h.webp",
                "tv_大哭": "cba61f05f3039b02a7ffc0dfcd9d7995df9fdd74.gif@48w_48h.webp",
                "tv_鼓掌": "be106e6b265883a9f28fbe10f7b765701e2618d4.gif@48w_48h.webp",
                "tv_抠鼻": "696d9f93e722144dc2a78aeffc569418fdf3d565.gif@48w_48h.webp",
                "tv_亲亲": "3534ea44ab74bd20352b88c245a06c4b4c46d271.gif@48w_48h.webp",
                "tv_调皮": "fcd967395fd14e4dd5829fa7e8a967ce23205e52.gif@48w_48h.webp",
                "tv_笑哭": "1c2fd1e8c9dde12812f86e5d4cbddd8993d98082.gif@48w_48h.webp",
                "tv_晕": "030040ec5c9ddc9e3d067658c4139e7314ab42f8.gif@48w_48h.webp",
                "tv_点赞": "30ecff401245fb56bcc1cf588d1809ac1ab1607c.gif@48w_48h.webp",
                "tv_害羞": "411a3e459e8580f5bfd9f639a408247c4b509935.gif@48w_48h.webp",
                "tv_睡着": "3c8b5e293261287a6203597e29b3de07df4d18c6.gif@48w_48h.webp",
                "tv_色": "a0c6d99ab0ab63b8648f5283ff72cec04b604828.gif@48w_48h.webp",
                "tv_吐血": "e17e4539e169d14a3389ff147afea760cebe5de5.gif@48w_48h.webp",
                "tv_无奈": "eb4cb5f07cfd177c7e6a7914316717e56d9cc1d0.gif@48w_48h.webp",
                "tv_再见": "344f61609ecce2008520dc8a977b6169215748a9.gif@48w_48h.webp",
                "tv_流汗": "390bccec65eaff536bd5bb2a0c5b8b0bdea47334.gif@48w_48h.webp",
                "tv_偷笑": "7f11e6f7f63e79112b833bd41fa13a83d7cd8474.gif@48w_48h.webp",
                "tv_抓狂":"a476b93ecd8e94ac3257323fd822f91cef212de2.gif@48w_48h.webp",
                "tv_黑人问号":"b609adf664be33224a9923262031165ae3e34cd2.gif@48w_48h.webp",
                "tv_困":"91c2bf34ecf842d7016c01d841db3d4074bd281f.gif@48w_48h.webp",
                "tv_打脸":"b0fad4856e59c1240e448437da3287bb5ce547e5.gif@48w_48h.webp",
                "tv_闭嘴":"a3fc5388b09e945be3f18fe23bfed5874a0285b7.gif@48w_48h.webp",
                "tv_鄙视":"293b5d459e6264ecf314d20937a936fa672ccd1e.gif@48w_48h.webp",
                "tv_腼腆":"30984e8264324f901d19bea85dada7103b695534.gif@48w_48h.webp",
                "tv_馋":"2525c5703c594e5f0752f68db8948773caebde47.gif@48w_48h.webp",
                "tv_可爱":"f92d20f76258bc5f33fc9d7c5e2a1d41fef19a7c.gif@48w_48h.webp",
                "tv_发财":"76131e52c9b033681b4c896c6024d29ef7ec7ec2.gif@48w_48h.webp",
                "tv_生病":"beb94829fe04f1a41bd6ca611e1f6ca9ca169afa.gif@48w_48h.webp",
                "tv_流鼻血":"8ef473f74a849420da712487b2f56ecca1f695f5.gif@48w_48h.webp",
                "tv_尴尬":"e0b84ef5ee3e5b8978e584c7c5a6550c51d15f84.gif@48w_48h.webp",
                "tv_大佬":"14ca0c05382b8741940942b2430b7a8d55c02f7e.gif@48w_48h.webp",
                "tv_流泪":"7e71cde7858f0cd50d74b0264aa26db612a8a167.png@48w_48h.webp",
                "tv_冷漠":"b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png@48w_48h.webp",
                "tv_皱眉":"72ccad6679fea0d14cce648b4d818e09b8ffea2d.png@48w_48h.webp",
                "tv_鬼脸":"0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png@48w_48h.webp",
                "tv_调侃":"4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png@48w_48h.webp",
                "tv_目瞪口呆":"0b8cb81a68de5d5365212c99375e7ace3e7891b7.png@48w_48h.webp",
            },

            master: "8c9b6d6637904da62d74d019cc6982de",
            friends: "0188229a9cfc284176ea9135cb9514cc",
            tagMeta: ["博主","友人","访客"],
            visitor: true // 阅读量统计
          }
        )
        new Valine(options);
        Fluid.utils.waitElementVisible('#valine .vcontent', () => {
          var imgSelector = '#valine .vcontent img:not(.vemoji)';
          Fluid.plugins.imageCaption(imgSelector);
          Fluid.plugins.fancyBox(imgSelector);
        })
      });
    });
  </script>
  <noscript>Please enable JavaScript to view the comments</noscript>


    </article>
  


          </article>
        </div>
      </div>
    </div>

    <div class="side-col d-none d-lg-block col-lg-2">
      <!-- 文章页面 - 右侧目录 -->

  <aside class="sidebar" style="margin-left: -1rem">
    <!-- 文章页面 - 右侧目录上方 -->
<div id="toc">
  <p class="toc-header">
    <i class="iconfont icon-list"></i>
    <span>目录</span>
  </p>
  <div class="toc-body" id="toc-body"></div>
</div>



  </aside>



    </div>
  </div>
</div>





  



  



  



  



  







    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <!-- 博客 - 搜索框 -->
<div
  class="modal fade"
  id="modalSearch"
  tabindex="-1"
  role="dialog"
  aria-labelledby="ModalLabel"
  aria-hidden="true"
>
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">
          搜索
        </h4>
        <button
          type="button"
          id="local-search-close"
          class="close"
          data-dismiss="modal"
          aria-label="Close"
        >
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input
            type="text"
            id="local-search-input"
            class="form-control validate"
          />
          <label data-error="x" data-success="v" for="local-search-input"
            >关键词</label
          >
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>

    

    
        <div class="modal fade" id="modalNotice" tabindex="-1" role="dialog" aria-hidden="true"
     style="font-family: 'Ma Shan Zheng', cursive; color: #ffffff;">
    <div class="modal-dialog modal-dialog-scrollable" role="document"
         style="font-family: 'Ma Shan Zheng', cursive;">
        <div class="modal-content" style="border-radius: 6px;">
            <!-- 公告头部 - 响应式设计 -->
            <div class="modal-header text-center"
                 style="padding: 1rem 1.5rem;border-bottom: 1px solid rgba(255,255,255,0.2)">
                <h4 class="modal-title w-100 font-weight-bold"
                    style="font-family: 'Microsoft YaHei', sans-serif;letter-spacing: 1px;text-shadow: 1px 1px 2px rgba(0,0,0,0.2);color: #ffffff;
                           font-size: 1.5rem; /* 默认PC端大小 */
                           /* 移动端适配 */
                           @media (max-width: 768px) {
                               font-size: 1.2rem;
                           }">
                    <div class="notice-title">
                        <i class="fas fa-bullhorn mr-2"> 围栏告示</i>
                    </div>
                    <small style="display: block; font-family: 'STKaiti', serif; font-size: 0.6em; color: #a0a0a0; margin-top: 3px;">
                        旧梦轻拾 · 谨识
                    </small>
                </h4>
            </div>

            <!-- 公告内容区 - 响应式设计 -->
            <div class="modal-body"
                 style="padding: 2rem; /* PC端 */
                        max-height: 70vh;
                        overflow-y: auto;
                        /* 移动端适配 */
                        @media (max-width: 768px) {
                            padding: 1rem;
                            max-height: 60vh;
                        }">
                <!-- 图片容器（响应式设计） -->
                <!--                <div class="announcement-hero"-->
                <!--                     style="margin-bottom: 2rem; /* PC端 */-->
                <!--                            /* 移动端适配 */-->
                <!--                            @media (max-width: 768px) {-->
                <!--                                margin-bottom: 1rem;-->
                <!--                            }">-->
                <!--                    <img src="http://blog.memory-life.icu/%E3%80%90%E5%93%B2%E9%A3%8E%E5%A3%81%E7%BA%B8%E3%80%91%E5%8A%A8%E6%BC%AB-%E5%A4%95%E9%98%B3%E9%93%81%E8%BD%A8.jpg"-->
                <!--                         alt="时光溯洄题图"-->
                <!--                         style="width: 100%; -->
                <!--                                max-height: 400px; /* PC端 */-->
                <!--                                object-fit: cover;-->
                <!--                                border-radius: 4px; -->
                <!--                                box-shadow: 0 2px 12px rgba(0,0,0,0.1);-->
                <!--                                /* 移动端适配 */-->
                <!--                                @media (max-width: 768px) {-->
                <!--                                    max-height: 30vh;-->
                <!--                                }"-->
                <!--                         loading="lazy">-->
                <!--                </div>-->

                <!-- 静态公告列表 - 响应式设计 -->
                <div class="announcement-list">
                    <div class="announcement-item"
                         style="margin-bottom: 2rem; /* PC端 */
                                padding: 2rem;
                                background: rgba(255,255,255,0.05);
                                border-radius: 8px;
                                /* 移动端适配 */
                                @media (max-width: 768px) {
                                    margin-bottom: 1rem;
                                    padding: 1rem;
                                }">
                        <h2 style="color: #d38532;
                                  font-weight: 600;
                                  font-size: 1.5rem; /* PC端 */
                                  margin-bottom: 1.2rem;
                                  letter-spacing: 0.5px;
                                  /* 移动端适配 */
                                  @media (max-width: 768px) {
                                      font-size: 1.2rem;
                                      margin-bottom: 1rem;
                                  }">
                            <i class="fas fa-calendar-check mr-2"></i>时光溯洄
                            <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">——
                                晨昏往事</small>
                        </h2>
                        <div style="color: #e0e0e0;
                                  line-height: 1.8; /* PC端 */
                                  font-size: 1.05rem;
                                  letter-spacing: 0.3px;
                                  /* 移动端适配 */
                                  @media (max-width: 768px) {
                                      line-height: 1.6;
                                      font-size: 0.95rem;
                                  }">
                            <!-- 内容保持不变 -->
                            <p style="margin-bottom: 1rem; text-indent: 2em;">你好。</p>
                            <!-- 其余段落内容... -->
                            <p style="margin-bottom: 1rem; text-indent: 2em;">
                                建站后的第813天，在百忙之中总算又能抽出时间来，对整个博客站点功能做整体的规划及优化完善。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em;">
                                在刚刚过去的几年时间里，往事皆以笔墨挥毫于时光素笺之上，数百天如一日，故事的书写从未间断过。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em; font-style: italic; color: #b8b8b8;">
                                时光悠悠，日月如流，过往的蹉跎岁月总在不经意间在心间回眸。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;">
                                俯仰之间，轻舟已过万重山。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em; font-weight: 500; color: #ffffff;">
                                蹉跎之处，往事皆成云烟散。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em;">
                                这几年的时光过得太快了，好像过去这段岁月里的所有事情都发生在一瞬间。</p>
                            <p style="margin-bottom: 1rem; text-indent: 2em;">
                                这几年的时光同样太久了，久到那些时日里仿佛囊括了自己的整个前半生。</p>
                            <p style="margin-bottom: 0; text-align: right; font-size: 0.95rem; color: #a0a0a0;">——
                                八百余个昼夜，当时只道是地久天长，如今回望，不过浮光掠影间的一瞬。</p>
                        </div>
                    </div>

                    <!-- 第二个公告项 - 响应式设计 -->
                    <div class="announcement-item"
                         style="margin-bottom: 2rem; /* PC端 */
                                padding: 2rem;
                                background: rgba(255,255,255,0.05);
                                border-radius: 8px;
                                /* 移动端适配 */
                                @media (max-width: 768px) {
                                    margin-bottom: 1rem;
                                    padding: 1rem;
                                }">
                        <h2 style="color: #6cc70b;
                                  font-weight: 600;
                                  font-size: 1.5rem; /* PC端 */
                                  margin-bottom: 1.2rem;
                                  letter-spacing: 0.5px;
                                  /* 移动端适配 */
                                  @media (max-width: 768px) {
                                      font-size: 1.2rem;
                                      margin-bottom: 1rem;
                                  }">
                            <i class="fas fa-book-open mr-2"></i>墨痕新注
                            <small style="display: block; font-size: 0.6em; color: #b8b8b8;text-align: right;">——
                                待起之章</small>
                        </h2>
                        <div style="color: #e0e0e0;
                                  line-height: 1.8; /* PC端 */
                                  font-size: 1.05rem;
                                  letter-spacing: 0.3px;
                                  /* 移动端适配 */
                                  @media (max-width: 768px) {
                                      line-height: 1.6;
                                      font-size: 0.95rem;
                                  }">
                            <!-- 列表内容 - 响应式设计 -->
                            <ul style="padding-left: 1.8rem; /* PC端 */
                                      margin-bottom: 1.5rem;
                                      /* 移动端适配 */
                                      @media (max-width: 768px) {
                                          padding-left: 1.5rem;
                                          margin-bottom: 1.2rem;
                                      }">
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">溯源计划：</span>新增博文"溯源计划"，旨在用先进的数字技术留住过去的旧时光，让家族的记忆在数字云端生长发芽，全站博文数量已达90+。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">围栏告示：</span>自去年夏天站点新增了“评论回复”功能后，至今时隔十余月，在芒种前夕本站久违地上线“围栏告示”功能，本公告栏会不定时更新，持续跟进记录最新站点功能调整日志，更多精彩内容请敬请期待。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">图片查看：</span>最近几周时间里，考虑到图文流量费用收取问题，暂时关闭了七牛云对象存储私有空间访问权限，故博文内的图文无法正常预览，择日考虑开启访问权限。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">壁纸下载：</span>后续计划实现壁纸下载功能，均为个人收集的共150+超高分辨率精美壁纸，提供在线预览以及下载功能。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">阅读体验：</span>规划完善文章内分页功能，并提供“最近更新”的文章列表，计划收录更新率较高的文章，譬如：阳台日记、叙事之外、岁月如歌、游戏人生等等，尽可能多的提升在线浏览和阅读体验。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">友链完善：</span>持续优化完善友链页面，整理归档个人常用的高质量网站合集，无偿分享给有缘人。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">音乐餐厅：</span>历经十余小时不间断调研和尝试，本站成功上线”音乐餐厅”功能，目前仅收录了个人在QQ音乐平台积累的两份歌单，再匆忙也要记得点播一首喜欢的音乐，没有音乐熏陶的心灵终究是充满缺憾的。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">三言两语：</span>每张照片都是时光的便签，随手一贴就记下了那天，本站结合Mamos实现并注入留言板功能，随缘记录那些藏在照片背后的故事。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">旧梦轻拾：</span>更新全站博客文章所属分类，共设有代码锋芒、部署之道、旧梦轻拾、人间片刻等十余种分类。
                                </li>
                                <li style="margin-bottom: 0.8rem; /* PC端 */
                                         position: relative;
                                         list-style-type: none;
                                         /* 移动端适配 */
                                         @media (max-width: 768px) {
                                             margin-bottom: 0.6rem;
                                         }">
                                    <span style="position: absolute;
                                               left: -1.8rem; /* PC端 */
                                               color: #6cc70b;
                                               /* 移动端适配 */
                                               @media (max-width: 768px) {
                                                   left: -1.5rem;
                                               }">◆</span>
                                    <span style="font-weight: bolder;">方寸之间：</span>博客应用版发布，更便捷的阅读体验来了！现已正式推出独立的桌面应用程序与移动端应用程序，暂时通过网盘和代码库提供安装包。
                                </li>
                                <p style="margin-bottom: 0; text-align: right; font-size: 0.9rem; color: #8a8a8a;">
                                    此公告最后更新于：<span style="color: #6cc70b;">2025/09/30晚</span>
                                </p>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 公告页脚 - 响应式设计 -->
            <div class="modal-footer"
                 style="border-top: 1px solid rgba(255,255,255,0.2);
                        padding: 1rem 1.5rem; /* PC端 */
                        justify-content: space-between;
                        /* 移动端适配 */
                        @media (max-width: 768px) {
                            padding: 0.8rem;
                        }">
                <small style="color: #ffffff;
                            font-size: 0.9rem; /* PC端 */
                            /* 移动端适配 */
                            @media (max-width: 768px) {
                                font-size: 0.8rem;
                            }">
                    <i class="iconfont icon-pen"></i>
                    <i class="fas fa-info-circle mr-1"></i>芒种前夕 · 旅途第813天
                    · 2025/05/28
                </small>
                <button id="confirm-btn" type="button" class="btn btn-sm" data-dismiss="modal"
                        style="background: #a0a0a0;
                               color: #ffffff;
                               border-radius: 4px;
                               padding: 0.5rem 1.2rem; /* PC端 */
                               border: none;
                               font-size: 0.9rem;
                               /* 移动端适配 */
                               @media (max-width: 768px) {
                                   padding: 0.3rem 0.8rem;
                                   font-size: 0.85rem;
                               }">
                    <i class="fas fa-check mr-1" style="color: #ffffff;">心已阅</i>
                </button>
            </div>
        </div>
    </div>
</div>

<style>
  .notice-title {
    display: flex;
    align-items: center;
    white-space: nowrap;
  }

  .notice-title:before,
  .notice-title:after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ddd; /* 横线颜色 */
    margin: 0 10px; /* 横线与文字的间距 */
  }
</style>


<style>
  /* 响应式模态框宽度 */
  @media (min-width: 992px) {
    #modalNotice .modal-dialog {
      max-width: 800px;
    }
  }

  @media (max-width: 991px) {
    #modalNotice .modal-dialog {
      margin: 0.5rem auto;
    }
  }
</style>

<script>
  // 页面加载完成后执行
  document.addEventListener('DOMContentLoaded', function () {
    // 检查是否首次访问
    if (!localStorage.getItem('hasShownPopup')) {
      // 动态加载notice.ejs内容
      fetch('_partials/notice.ejs')  // 替换为实际路径
        .then(response => response.text())
        .then(html => {
          // 插入到页面body末尾
          document.body.insertAdjacentHTML('beforeend', html);

          // 手动初始化Bootstrap模态框
          $('#modalNotice').modal('show');

          // 标记为已显示
          localStorage.setItem('hasShownPopup', 'true');

          // 监听关闭事件
          $('#modalNotice').on('hidden.bs.modal', function () {
            // 可选的后续处理
          });
        })
        .catch(error => {
          console.error('加载公告栏失败:', error);
          // 备用方案：显示简单弹窗
          const fallbackHTML = `
                <div class="modal-backdrop" style="/* 样式 */">
                    <div class="modal-content">/* 内容 */</div>
                </div>`;
          document.body.insertAdjacentHTML('beforeend', fallbackHTML);
        });
    }
  });
</script>

    

    
  </main>

  <footer>
    <!-- 博客 - 页脚 -->
<div class="footer-inner">
  
    <div class="footer-content">
       <a href="https://hexo.fluid-dev.com/docs/guide/" target="_blank" rel="nofollow noopener"> <span>Memory | 个人文档站点</span> </a>
<i class="iconfont icon-love"></i> <a href="https://hexo.fluid-dev.com/docs/guide/" target="_blank" rel="nofollow noopener"> <span>配置指南 | Hexo Fluid 用户手册</span> </a> 
    </div>
  

  

  
    <!-- 备案信 ICP for China -->
    <div class="beian">
  <span>
    <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
      京ICP证123456号
    </a>
  </span>
  
    
      <span>
        <a
          href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=12345678"
          rel="nofollow noopener"
          class="beian-police"
          target="_blank"
        >
          
            <span style="visibility: hidden; width: 0">|</span>
            <img src="/blog/img/police_beian.png" alt="police-icon"/>
          
          <span>京公网安备12345678号</span>
        </a>
      </span>
    
  
</div>

  

  

</div>

<!-- 评论框美化 -->
<style>
    #comments .veditor{
        min-height: 20vh;
        background-image: url(http://blog.memory-life.icu/pathway0716.jpg);
        background-size: contain;
        background-repeat: no-repeat;
        background-position: right;
        background-color: rgba(255,255,255,0);
        resize: none;}
</style>

<script>
    //   自定义邮箱审核规则
    document.body.addEventListener('click', function(e) {
        if (e.target.classList.contains('vsubmit')) {
            const email = document.querySelector('input[type=email]');
            const nick = document.querySelector('input[name=nick]');
            const reg = /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
            if (!email.value || !nick.value || !reg.test(email.value)) {
                const str = `<div class="valert text-center"><div class="vtext">请填写正确的昵称和邮箱！</div></div>`;
                const vmark = document.querySelector('.vmark');
                vmark.innerHTML = str;
                vmark.style.display = 'block';
                setTimeout(function() {
                    vmark.style.display = 'none';
                    vmark.innerHTML = '';
                }, 2500);
            }
        }
    })
</script>



  </footer>

  <!-- Scripts -->
  
  <script  src="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://lib.baomitu.com/nprogress/0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://lib.baomitu.com/jquery/3.6.0/jquery.min.js" ></script>
<script  src="https://lib.baomitu.com/twitter-bootstrap/4.6.1/js/bootstrap.min.js" ></script>
<script  src="/blog/js/events.js" ></script>
<script  src="/blog/js/plugins.js" ></script>


  <script  src="https://lib.baomitu.com/typed.js/2.0.12/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var subtitle = document.getElementById('subtitle');
      if (!subtitle || !typing) {
        return;
      }
      var text = subtitle.getAttribute('data-typed-text');
      
        typing(text);
      
    })(window, document);
  </script>







  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/tocbot/4.18.2/tocbot.min.js', function() {
    var toc = jQuery('#toc');
    if (toc.length === 0 || !window.tocbot) { return; }
    var boardCtn = jQuery('#board-ctn');
    var boardTop = boardCtn.offset().top;

    window.tocbot.init(Object.assign({
      tocSelector     : '#toc-body',
      contentSelector : '.markdown-body',
      linkClass       : 'tocbot-link',
      activeLinkClass : 'tocbot-active-link',
      listClass       : 'tocbot-list',
      isCollapsedClass: 'tocbot-is-collapsed',
      collapsibleClass: 'tocbot-is-collapsible',
      scrollSmooth    : true,
      includeTitleTags: true,
      headingsOffset  : -boardTop,
    }, CONFIG.toc));
    if (toc.find('.toc-list-item').length > 0) {
      toc.css('visibility', 'visible');
    }

    Fluid.events.registerRefreshCallback(function() {
      if ('tocbot' in window) {
        tocbot.refresh();
        var toc = jQuery('#toc');
        if (toc.length === 0 || !tocbot) {
          return;
        }
        if (toc.find('.toc-list-item').length > 0) {
          toc.css('visibility', 'visible');
        }
      }
    });
  });
</script>


  <script src=https://lib.baomitu.com/clipboard.js/2.0.11/clipboard.min.js></script>

  <script>Fluid.plugins.codeWidget();</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/anchor-js/4.3.1/anchor.min.js', function() {
    window.anchors.options = {
      placement: CONFIG.anchorjs.placement,
      visible  : CONFIG.anchorjs.visible
    };
    if (CONFIG.anchorjs.icon) {
      window.anchors.options.icon = CONFIG.anchorjs.icon;
    }
    var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
    var res = [];
    for (var item of el) {
      res.push('.markdown-body > ' + item.trim());
    }
    if (CONFIG.anchorjs.placement === 'left') {
      window.anchors.options.class = 'anchorjs-link-left';
    }
    window.anchors.add(res.join(', '));

    Fluid.events.registerRefreshCallback(function() {
      if ('anchors' in window) {
        anchors.removeAll();
        var el = (CONFIG.anchorjs.element || 'h1,h2,h3,h4,h5,h6').split(',');
        var res = [];
        for (var item of el) {
          res.push('.markdown-body > ' + item.trim());
        }
        if (CONFIG.anchorjs.placement === 'left') {
          anchors.options.class = 'anchorjs-link-left';
        }
        anchors.add(res.join(', '));
      }
    });
  });
</script>


  
<script>
  Fluid.utils.createScript('https://lib.baomitu.com/fancybox/3.5.7/jquery.fancybox.min.js', function() {
    Fluid.plugins.fancyBox();
  });
</script>


  <script>Fluid.plugins.imageCaption();</script>

  <script  src="/blog/js/local-search.js" ></script>

  <script defer src="/blog/js/leancloud.js" ></script>




    
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>



<!-- 主题的启动项，将它保持在最底部 -->
<!-- the boot of the theme, keep it at the bottom -->
<script  src="/blog/js/boot.js" ></script>


  

  <noscript>
    <div class="noscript-warning">博客在允许 JavaScript 运行的环境下浏览效果更佳</div>
  </noscript>
</body>
</html>
